文件名称:java注册界面
文件大小:3KB
文件格式:ZIP
更新时间:2016-07-04 06:49:50
java GUI swing awt
public class Zhuce {
public Zhuce() {
ZhuceFrame zhuce = new ZhuceFrame();
zhuce.setVisible(true);
}
public static void main(String args[]){
new Zhuce();
}
}
class ZhuceFrame extends JFrame { // 框架类
private Toolkit tool; // Abstract Window Toolkit 的所有实际实现的抽象超类 查询 API
public ZhuceFrame() {
setTitle("用户注册");
tool = Toolkit.getDefaultToolkit();
Dimension ds = tool.getScreenSize();
int w = ds.width;
int h = ds.height;
setBounds((w - 300) / 2, (h - 300) / 2, 300, 400);
setResizable(false);
ZhucePanel rp = new ZhucePanel(this);
add(rp);
}
}
class ZhucePanel extends JPanel implements ActionListener { // 容器类
private JLabel titlelabel, namelabel, pwdlabel1, pwdlabel2, sexlabel,
agelabel, classlabel,interestlabel;
private JTextField namefield, agefield;
private JPasswordField pwdfield1, pwdfield2;
private JButton commitbtn, resetbtn, cancelbtn;
private JRadioButton rbtn1, rbtn2;
private JComboBox combo;
private JCheckBox [] jcbArray={new JCheckBox("电脑"),new JCheckBox("音乐"), new JCheckBox("旅游"),new JCheckBox("购物"),new JCheckBox("运动"),new JCheckBox("其他")};
private Vector
【文件预览】:
Zhuce.java