📄 changeinfo.java
字号:
jPanel1.add(getJTextField2(), null);
jPanel1.add(getJTextField3(), null);
jPanel1.add(getJPanel3(), null);
jPanel1.add(jLabel16, null);
jPanel1.add(jLabel17, null);
jPanel1.add(jLabel18, null);
jPanel1.add(jLabel19, null);
jPanel1.add(getJTextField4(), null);
jPanel1.add(getJTextField5(), null);
}
return jPanel1;
}
/**
* 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.setBounds(new Rectangle(1, 1, 383, 39));
jPanel2.setBackground(new Color(235, 250, 255));
jPanel2.setBorder(BorderFactory.createLineBorder(new Color(118,
171, 211), 1));
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.setSelectedItem(myBean.getSex());
jComboBox.setBounds(new Rectangle(40, 208, 55, 23));
jComboBox.setFont(new Font("Dialog", Font.PLAIN, 12));
}
return jComboBox;
}
/**
* This method initializes jTextField
*
* @return javax.swing.JTextField
*/
private JTextField getJTextField() {
if (jTextField == null) {
jTextField = new JTextField();
jTextField.setText(myBean.getAge());
jTextField.setBounds(new Rectangle(151, 208, 55, 23));
jTextField.setToolTipText("提示!!!年龄在0到150之间");
}
return jTextField;
}
/**
* This method initializes jTextField1
*
* @return javax.swing.JTextField
*/
private JTextField getJTextField1() {
if (jTextField1 == null) {
jTextField1 = new JTextField();
jTextField1.setText(myBean.getName());
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.setBounds(new Rectangle(40, 244, 55, 23));
jComboBox1.setFont(new Font("Dialog", Font.PLAIN, 12));
}
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.setBounds(new Rectangle(151, 244, 55, 23));
jComboBox2.setFont(new Font("Dialog", Font.PLAIN, 12));
}
return jComboBox2;
}
/**
* This method initializes jTextField2
*
* @return javax.swing.JTextField
*/
private JTextField getJTextField2() {
if (jTextField2 == null) {
jTextField2 = new JTextField();
jTextField2.setText(myBean.getInfo());
jTextField2.setBounds(new Rectangle(67, 275, 302, 24));
}
return jTextField2;
}
/**
* This method initializes jTextField3
*
* @return javax.swing.JTextField
*/
private JTextField getJTextField3() {
if (jTextField3 == null) {
jTextField3 = new JTextField();
jTextField3.setText(myBean.getNickName());
jTextField3.setBounds(new Rectangle(75, 50, 135, 22));
jTextField3.setFont(new Font("Dialog", Font.PLAIN, 12));
}
return jTextField3;
}
/**
* This method initializes jPanel3
*
* @return javax.swing.JPanel
*/
private JPanel getJPanel3() {
if (jPanel3 == null) {
jPanel3 = new JPanel();
jPanel3.setLayout(null);
jPanel3.setBounds(new Rectangle(78, 114, 233, 47));
jPanel3.setBorder(BorderFactory.createLineBorder(new Color(118,
171, 211), 1));
jPanel3.setBackground(Color.white);
jPanel3.add(getJTextArea(), null);
}
return jPanel3;
}
/**
* This method initializes jTextArea
*
* @return javax.swing.JTextArea
*/
private JTextArea getJTextArea() {
if (jTextArea == null) {
jTextArea = new JTextArea();
jTextArea.setText(myBean.getInfo());
jTextArea.setBounds(new Rectangle(3, 3, 228, 41));
}
return jTextArea;
}
/**
* 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 portrait = jLabel16.getText();
qq2009.getJLabel().setIcon(
new ImageIcon(getClass().getResource(
"/picture/" + portrait)));
String nickName = jTextField3.getText();
String sex = jComboBox.getSelectedItem().toString();
String age = jTextField.getText();
String name = jTextField1.getText();
String info = jTextArea.getText();
controller.changeInfo(nickName, portrait, sex, age, name,
info);
ChangeInfo.this.dispose();
}
});
}
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("");
jTextField5.setText("");
jTextArea.setText("");
jTextField.setText("");
jTextField1.setText("");
jTextField2.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) {
ChangeInfo.this.dispose();
}
});
}
return jButton2;
}
public JLabel getJLabel16() {
return jLabel16;
}
/**
* This method initializes jTextField4
*
* @return javax.swing.JTextField
*/
private JTextField getJTextField4() {
if (jTextField4 == null) {
jTextField4 = new JTextField();
jTextField4.setText("1987-11-22");
jTextField4.setBounds(new Rectangle(255, 243, 108, 25));
jTextField4.setEditable(false);
jTextField4.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent e) {
JDialog jDialog = new JDialog(ChangeInfo.this, true);// 内部类中持有外部类的this的方法
jDialog.setContentPane(new JCalendar(jTextField4, jDialog));
jDialog.pack();
jDialog.setResizable(false);
jDialog.setVisible(true);
}
});
}
return jTextField4;
}
/**
* This method initializes jTextField5
*
* @return javax.swing.JTextField
*/
private JTextField getJTextField5() {
if (jTextField5 == null) {
jTextField5 = new JTextField();
jTextField5.setText("0.0小时");
jTextField5.setBounds(new Rectangle(75, 80, 135, 22));
}
return jTextField5;
}
} // @jve:decl-index=0:visual-constraint="10,10"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -