📄 register.java
字号:
/**
* This method initializes jPanel2
*
* @return javax.swing.JPanel
*/
private JPanel getJPanel2() {
if (jPanel2 == null) {
jLabel1 = new JLabel();
jLabel1.setBounds(new Rectangle(73, 9, 177, 27));
jLabel1
.setFont(new Font("\u534e\u6587\u7ec6\u9ed1", Font.BOLD, 18));
jLabel1.setForeground(new Color(102, 153, 255));
jLabel1.setText("个人设置—个人资料");
jLabel = new JLabel();
jLabel.setBounds(new Rectangle(25, 5, 32, 31));
jLabel.setIcon(new ImageIcon(getClass().getResource(
"/picture/groupmanage.gif")));
jLabel.setText("");
jPanel2 = new JPanel();
jPanel2.setLayout(null);
jPanel2.setBackground(new Color(235, 250, 255));
jPanel2.setBorder(BorderFactory.createLineBorder(new Color(118,
171, 211), 1));
jPanel2.setBounds(new Rectangle(1, 1, 383, 39));
jPanel2.add(jLabel, null);
jPanel2.add(jLabel1, null);
}
return jPanel2;
}
/**
* This method initializes jComboBox
*
* @return javax.swing.JComboBox
*/
private JComboBox getJComboBox() {
if (jComboBox == null) {
jComboBox = new JComboBox();
jComboBox.addItem("男");
jComboBox.addItem("女");
jComboBox.setFont(new Font("Dialog", Font.PLAIN, 12));
jComboBox.setBounds(new Rectangle(40, 208, 55, 23));
}
return jComboBox;
}
/**
* This method initializes jTextField
*
* @return javax.swing.JTextField
*/
private JTextField getJTextField() {
if (jTextField == null) {
jTextField = new JTextField();
jTextField.setToolTipText("提示!!!年龄在0到150之间");
jTextField.setBounds(new Rectangle(151, 208, 55, 23));
}
return jTextField;
}
/**
* This method initializes jTextField1
*
* @return javax.swing.JTextField
*/
private JTextField getJTextField1() {
if (jTextField1 == null) {
jTextField1 = new JTextField();
jTextField1.setBounds(new Rectangle(255, 208, 108, 23));
}
return jTextField1;
}
/**
* This method initializes jComboBox1
*
* @return javax.swing.JComboBox
*/
private JComboBox getJComboBox1() {
if (jComboBox1 == null) {
jComboBox1 = new JComboBox();
jComboBox1.addItem("牛");
jComboBox1.addItem("兔");
jComboBox1.addItem("虎");
jComboBox1.addItem("龙");
jComboBox1.addItem("马");
jComboBox1.addItem("鸡");
jComboBox1.addItem("羊");
jComboBox1.addItem("蛇");
jComboBox1.setFont(new Font("Dialog", Font.PLAIN, 12));
jComboBox1.setBounds(new Rectangle(40, 244, 55, 23));
}
return jComboBox1;
}
/**
* This method initializes jComboBox2
*
* @return javax.swing.JComboBox
*/
private JComboBox getJComboBox2() {
if (jComboBox2 == null) {
jComboBox2 = new JComboBox();
jComboBox2.addItem("A型");
jComboBox2.addItem("B型");
jComboBox2.addItem("AB型");
jComboBox2.addItem("O型");
jComboBox2.setFont(new Font("Dialog", Font.PLAIN, 12));
jComboBox2.setBounds(new Rectangle(151, 244, 55, 23));
}
return jComboBox2;
}
/**
* This method initializes jTextField3
*
* @return javax.swing.JTextField
*/
private JTextField getJTextField3() {
if (jTextField3 == null) {
jTextField3 = new JTextField();
jTextField3.setFont(new Font("Dialog", Font.PLAIN, 12));
jTextField3.setBounds(new Rectangle(76, 51, 135, 22));
}
return jTextField3;
}
/**
* This method initializes jButton
*
* @return javax.swing.JButton
*/
private JButton getJButton() {
if (jButton == null) {
jButton = new JButton();
jButton.setBounds(new Rectangle(299, 317, 73, 23));
jButton.setBackground(new Color(126, 191, 242));
jButton.setFont(new Font("Dialog", Font.PLAIN, 12));
jButton.setForeground(new Color(51, 51, 255));
jButton.setText("确定");
jButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
String nickName = jTextField3.getText();
String password1 = String.valueOf(jPasswordField
.getPassword());
String password2 = String.valueOf(jPasswordField1
.getPassword());
String portrait = jLabel16.getText();
String sex = jComboBox.getSelectedItem().toString();
String age = jTextField.getText();
String name = jTextField1.getText();
String info = jTextArea.getText();
controller.register(nickName, password1, password2,
portrait, sex, age, name, info);
}
});
}
return jButton;
}
private JButton getJButton1() {
if (jButton1 == null) {
jButton1 = new JButton();
jButton1.setBounds(new Rectangle(385, 317, 73, 23));
jButton1.setBackground(new Color(126, 191, 242));
jButton1.setFont(new Font("Dialog", Font.PLAIN, 12));
jButton1.setForeground(new Color(51, 51, 255));
jButton1.setText("取消");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(ActionEvent e) {
jTextField3.setText("");
jPasswordField.setText("");
jTextArea.setText("");
jTextField.setText("");
jTextField1.setText("");
}
});
}
return jButton1;
}
private JButton getJButton2() {
if (jButton2 == null) {
jButton2 = new JButton();
jButton2.setBounds(new Rectangle(472, 317, 73, 23));
jButton2.setBackground(new Color(126, 191, 242));
jButton2.setFont(new Font("Dialog", Font.PLAIN, 12));
jButton2.setForeground(new Color(51, 51, 255));
jButton2.setText("返回");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
Register.this.dispose();
login.setVisible(true);
}
});
}
return jButton2;
}
private JPasswordField getJPasswordField() {
if (jPasswordField == null) {
jPasswordField = new JPasswordField();
jPasswordField.setToolTipText("提示!!密码不能为空,且长度在6到12位之间");
jPasswordField.setBounds(new Rectangle(76, 80, 135, 22));
}
return jPasswordField;
}
// Portrait.getJButton1.mouseClicked(MouseEvent)中被调用
public JLabel getJLabel16() {
return jLabel16;
}
/**
* This method initializes jTextField4
*
* @return javax.swing.JTextField
*/
private JTextField getJTextField4() {
if (jTextField4 == null) {
jTextField4 = new JTextField();
jTextField4.setEditable(false);
jTextField4.setBounds(new Rectangle(255, 243, 108, 23));
jTextField4.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent e) {
JDialog jDialog = new JDialog(Register.this, true);// 内部类中持有外部类的this的方法
jDialog.setContentPane(new JCalendar(jTextField4, jDialog));
jDialog.pack();
jDialog.setResizable(false);
jDialog.setVisible(true);
}
});
}
return jTextField4;
}
/**
* This method initializes jPanel3
*
* @return javax.swing.JPanel
*/
private JPanel getJPanel3() {
if (jPanel3 == null) {
jPanel3 = new JPanel();
jPanel3.setLayout(null);
jPanel3.setBorder(BorderFactory.createCompoundBorder(BorderFactory
.createTitledBorder(BorderFactory.createLineBorder(
new Color(51, 204, 255), 1),
"\u4e2a\u6027\u7b7e\u540d",
TitledBorder.DEFAULT_JUSTIFICATION,
TitledBorder.DEFAULT_POSITION, new Font("Dialog",
Font.BOLD, 12), Color.red),
new SoftBevelBorder(SoftBevelBorder.LOWERED)));
jPanel3.setBounds(new Rectangle(4, 138, 360, 60));
jPanel3.add(getJTextArea(), null);
}
return jPanel3;
}
/**
* This method initializes jTextArea
*
* @return javax.swing.JTextArea
*/
private JTextArea getJTextArea() {
if (jTextArea == null) {
jTextArea = new JTextArea();
jTextArea.setBounds(new Rectangle(5, 16, 352, 38));
}
return jTextArea;
}
/**
* This method initializes jPasswordField1
*
* @return javax.swing.JPasswordField
*/
private JPasswordField getJPasswordField1() {
if (jPasswordField1 == null) {
jPasswordField1 = new JPasswordField();
jPasswordField1.setBounds(new Rectangle(76, 112, 135, 22));
}
return jPasswordField1;
}
} // @jve:decl-index=0:visual-constraint="10,10"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -