//设计会员登记录入界面
import java.awt.*;//引用
import javax.swing.*;
public class Face {
public static void main(String[] args) {
JLabel a1, a2, a3, a4, a5, a6, a7, a8, a9, a10;// 声明标签组件
JComboBox ca1, ca2;
String[] ja = { "2017-12-29" };// 声明下拉列表框组件
String[] jv = { "是", "否" };// 声明下拉列表框组件
JTextField tf1, tf2, tf3, tf4, tf5, tf6, tf7;// 声明文本组件
JFrame jf = new JFrame("会员登记录入");
jf.setVisible(true);// 设置窗体可见
jf.setSize(400, 600);// 设置窗口初显大小
jf.setLocationRelativeTo(null);
JPanel jp = new JPanel();
jp.setLayout(new BorderLayout(5, 0));// 构造一个边界布局
JPanel jpTop = new JPanel();
jpTop.setLayout(new FlowLayout());// 构造一个流布局
JPanel jpcenter = new JPanel();
jpcenter.setLayout(new GridLayout(4, 2, 5, 5));// 构造一个网格布局
JPanel jpbottom = new JPanel();
jpbottom.setLayout(new GridLayout(1, 2, 5, 5));// 构造一个网格布局
a1 = new JLabel("会员登记录入");// 创建组件并赋值
a2 = new JLabel("办卡日期");
a3 = new JLabel("会员卡号条形码");
a4 = new JLabel("姓名");
a5 = new JLabel("性别");
a6 = new JLabel("联系电话");
a7 = new JLabel("类型");
a8 = new JLabel("折扣");
a9 = new JLabel("是否挂失");
a10 = new JLabel("工作单位");
ca1 = new JComboBox(ja);
ca2 = new JComboBox(jv);
tf1 = new JTextField("162507");
tf2 = new JTextField("大黄");
tf3 = new JTextField("男");
tf4 = new JTextField("110");
tf5 = new JTextField("普通会员");
tf6 = new JTextField("不知");
tf7 = new JTextField("不晓得");
jpTop.add(a1);// 把组件添加到面板上
jpcenter.add(a2);
jpcenter.add(a1);
jpcenter.add(a3);
jpcenter.add(tf1);
jpcenter.add(a4);
jpcenter.add(tf2);
jpcenter.add(a5);
jpcenter.add(tf3);
jpcenter.add(a6);
jpcenter.add(tf4);
jpcenter.add(a7);
jpcenter.add(tf5);
jpcenter.add(a8);
jpcenter.add(tf6);
jpcenter.add(a9);
jpcenter.add(a2);
jpbottom.add(a10);
jpbottom.add(tf7);
jp.add(jpTop, BorderLayout.NORTH);
jp.add(jpcenter, BorderLayout.CENTER);
jp.add(jpbottom, BorderLayout.SOUTH);
jf.add(jp);
}
}![](https://img-blog.csdn.net/20171229140912750?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvbmFueWltdQ==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center)
![](https://img-blog.csdn.net/20171229140917752?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvbmFueWltdQ==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center)
![](https://img-blog.csdn.net/20171229140923815?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvbmFueWltdQ==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center)
设计会员登记录入界面
最新推荐文章于 2023-04-22 18:29:42 发布