⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 employeedetailinfordialog.java~21~

📁 本员工管理系统使公司员工能通过网络来查询信息、请假
💻 JAVA~21~
字号:
package employeemanagersystem;

import java.awt.*;
import javax.swing.*;
import java.awt.Rectangle;
import javax.swing.BorderFactory;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

/**
 * <p>Title: </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2007</p>
 *
 * <p>Company: </p>
 *
 * @author not attributable
 * @version 1.0
 */
public class EmployeeDetailInforDialog
    extends JDialog
{
  SelectEmployeeInforByEmpIdFrame byEmpIdFrame = null;
  SelectEmployeeInforByEmpNameFrame byEmpNameFrame = null;
  SelectEmployeeInforByDepIdFrame byDepIdFrame = null;
  SelectAllEmployeeInforFrame allFrame = null;
  SelectEmployeeInforByJobIdFrame byJobIdFrame = null;

  int row = 0;

  public EmployeeDetailInforDialog(Frame owner, String title, boolean modal)
  {
    super(owner, title, modal);
    try
    {
      setDefaultCloseOperation(DISPOSE_ON_CLOSE);
      jbInit();
      pack();
    }
    catch (Exception exception)
    {
      exception.printStackTrace();
    }
  }

  public EmployeeDetailInforDialog(SelectEmployeeInforByEmpIdFrame byEmpIdFrame,
                                   String title, boolean modal, int row)
  {
    super(byEmpIdFrame, title, modal);
    try
    {
      setDefaultCloseOperation(DISPOSE_ON_CLOSE);
      jbInit();
      pack();
    }
    catch (Exception exception)
    {
      exception.printStackTrace();
    }
    //System.out.println(byEmpIdFrame.getTitle());
    this.byEmpIdFrame = byEmpIdFrame;
    this.row = row;
  }

  public EmployeeDetailInforDialog(SelectEmployeeInforByEmpNameFrame
                                   byEmpNameFrame, String title, boolean modal,
                                   int row)
  {
    super(byEmpNameFrame, title, modal);
    try
    {
      setDefaultCloseOperation(DISPOSE_ON_CLOSE);
      jbInit();
      pack();
    }
    catch (Exception exception)
    {
      exception.printStackTrace();
    }
    //System.out.println(byEmpNameFrame.getTitle());
    this.byEmpNameFrame = byEmpNameFrame;
    this.row = row;
  }

  public EmployeeDetailInforDialog(SelectEmployeeInforByDepIdFrame byDepIdFrame,
                                   String title, boolean modal, int row)
  {
    super(byDepIdFrame, title, modal);
    try
    {
      setDefaultCloseOperation(DISPOSE_ON_CLOSE);
      jbInit();
      pack();
    }
    catch (Exception exception)
    {
      exception.printStackTrace();
    }
    //System.out.println(byDepIdFrame.getTitle());
    this.byDepIdFrame = byDepIdFrame;
    this.row = row;
  }

  public EmployeeDetailInforDialog(SelectAllEmployeeInforFrame allFrame,
                                   String title, boolean modal, int row)
  {
    super(allFrame, title, modal);
    try
    {
      setDefaultCloseOperation(DISPOSE_ON_CLOSE);
      jbInit();
      pack();
    }
    catch (Exception exception)
    {
      exception.printStackTrace();
    }
    //System.out.println(allFrame.getTitle());
    this.allFrame = allFrame;
    this.row = row;
  }

  public EmployeeDetailInforDialog(SelectEmployeeInforByJobIdFrame byJobIdFrame,
                                   String title, boolean modal, int row)
  {
    super(byJobIdFrame, title, modal);
    try
    {
      setDefaultCloseOperation(DISPOSE_ON_CLOSE);
      jbInit();
      pack();
    }
    catch (Exception exception)
    {
      exception.printStackTrace();
    }
    //System.out.println(byJobIdFrame.getTitle());
    this.byJobIdFrame = byJobIdFrame;
    this.row = row;
  }

  public EmployeeDetailInforDialog()
  {
    this(new Frame(), "EmployeeDetailInforDialog", false);
  }

  private void jbInit()
      throws Exception
  {
    this.getContentPane().setLayout(null);
    jPanel1.setBorder(BorderFactory.createEtchedBorder());
    jPanel1.setBounds(new Rectangle(7, 6, 703, 435));
    jPanel1.setLayout(null);
    empIdTextField.setBorder(BorderFactory.createEtchedBorder());
    empIdTextField.setEditable(false);
    empIdTextField.setBounds(new Rectangle(91, 13, 127, 25));
    depLabel.setText("部  门:");
    depLabel.setBounds(new Rectangle(16, 53, 61, 22));
    depNameTextField.setBorder(BorderFactory.createEtchedBorder());
    depNameTextField.setEditable(false);
    depNameTextField.setBounds(new Rectangle(91, 54, 126, 27));
    jobLabel.setText("工  种:");
    jobLabel.setBounds(new Rectangle(16, 92, 62, 27));
    jobTextField.setBorder(BorderFactory.createEtchedBorder());
    jobTextField.setEditable(false);
    jobTextField.setBounds(new Rectangle(91, 92, 126, 29));
    nameLabel.setText("姓  名:");
    nameLabel.setBounds(new Rectangle(335, 13, 50, 20));
    nameTextField.setBounds(new Rectangle(433, 13, 105, 24));
    degreeLabel.setText("学  历:");
    degreeLabel.setBounds(new Rectangle(335, 61, 50, 18));
    degreeComboBox.setBounds(new Rectangle(433, 59, 104, 21));
    for (int i = 0; i < degrees.length; i++)
    {
      degreeComboBox.addItem(degrees[i].trim());
    }
    isMarryLabel.setText("婚  否:");
    isMarryLabel.setBounds(new Rectangle(335, 92, 52, 26));
    marryRadioButton.setText("是");
    marryRadioButton.setBounds(new Rectangle(433, 95, 59, 24));
    notMarryRadioButton.setText("否");
    notMarryRadioButton.setBounds(new Rectangle(509, 94, 71, 23));
    telLabel.setText("电  话:");
    telLabel.setBounds(new Rectangle(16, 142, 61, 23));
    telTextField.setBounds(new Rectangle(92, 141, 125, 24));
    addressLabel.setText("地  址:");
    addressLabel.setBounds(new Rectangle(335, 140, 64, 25));
    addressTextField.setBounds(new Rectangle(429, 140, 216, 25));
    birthLabel.setText("出生年月:");
    birthLabel.setBounds(new Rectangle(15, 187, 59, 25));
    birthTextField.setBounds(new Rectangle(93, 182, 123, 28));
    idCardLabel.setText("身份证号:");
    idCardLabel.setBounds(new Rectangle(334, 179, 61, 23));
    idCardTextField.setBounds(new Rectangle(429, 178, 149, 27));
    contractLabel.setText("合同期限:");
    contractLabel.setBounds(new Rectangle(16, 235, 61, 24));
    contractTextField.setBorder(BorderFactory.createEtchedBorder());
    contractTextField.setEditable(false);
    contractTextField.setBounds(new Rectangle(92, 233, 124, 25));
    contractBeginLabel.setText("合同开始时间:");
    contractBeginLabel.setBounds(new Rectangle(333, 232, 97, 24));
    contractBeginTextField.setBorder(BorderFactory.createEtchedBorder());
    contractBeginTextField.setEditable(false);
    contractBeginTextField.setBounds(new Rectangle(428, 229, 151, 29));
    exhibitionLabel.setText("工作表现:");
    exhibitionLabel.setBounds(new Rectangle(16, 286, 60, 23));
    exhibitionTextField.setBorder(BorderFactory.createEtchedBorder());
    exhibitionTextField.setEditable(false);
    exhibitionTextField.setBounds(new Rectangle(92, 286, 123, 27));
    updateButton.setBounds(new Rectangle(183, 354, 63, 27));
    updateButton.setText("更新");
    updateButton.addActionListener(new
                                   EmployeeDetailInforDialog_updateButton_actionAdapter(this));
    deleteButton.setBounds(new Rectangle(382, 354, 66, 26));
    deleteButton.setText(" 删除");
    deleteButton.addActionListener(new
                                   EmployeeDetailInforDialog_deleteButton_actionAdapter(this));
    buttonGroup1.add(marryRadioButton);
    buttonGroup1.add(notMarryRadioButton);
    jPanel1.add(empIdLabel);
    jPanel1.add(empIdTextField);
    jPanel1.add(depLabel);
    jPanel1.add(depNameTextField);
    jPanel1.add(jobLabel);
    jPanel1.add(jobTextField);
    jPanel1.add(nameLabel);
    jPanel1.add(nameTextField);
    jPanel1.add(degreeLabel);
    jPanel1.add(degreeComboBox);
    jPanel1.add(isMarryLabel);
    jPanel1.add(marryRadioButton);
    jPanel1.add(notMarryRadioButton);
    jPanel1.add(telLabel);
    jPanel1.add(telTextField);
    jPanel1.add(addressLabel);
    jPanel1.add(addressTextField);
    jPanel1.add(birthLabel);
    jPanel1.add(idCardLabel);
    jPanel1.add(idCardTextField);
    jPanel1.add(contractTextField);
    jPanel1.add(birthTextField);
    jPanel1.add(contractBeginLabel);
    jPanel1.add(contractLabel);
    jPanel1.add(contractBeginTextField);
    jPanel1.add(exhibitionLabel);
    jPanel1.add(exhibitionTextField);
    jPanel1.add(updateButton);
    jPanel1.add(deleteButton);
    this.getContentPane().add(jPanel1);
    empIdLabel.setText("编  号:");
    empIdLabel.setBounds(new Rectangle(17, 13, 59, 25));
  }

  VectorVariable vv = new VectorVariable();
  String[] degrees = vv.degreeValues;
  JPanel jPanel1 = new JPanel();
  JLabel empIdLabel = new JLabel();
  JTextField empIdTextField = new JTextField();
  JLabel depLabel = new JLabel();
  JTextField depNameTextField = new JTextField();
  JLabel jobLabel = new JLabel();
  JTextField jobTextField = new JTextField();
  JLabel nameLabel = new JLabel();
  JTextField nameTextField = new JTextField();
  JLabel degreeLabel = new JLabel();
  JComboBox degreeComboBox = new JComboBox();
  JLabel isMarryLabel = new JLabel();
  JRadioButton marryRadioButton = new JRadioButton();
  JRadioButton notMarryRadioButton = new JRadioButton();
  JLabel telLabel = new JLabel();
  JTextField telTextField = new JTextField();
  JLabel addressLabel = new JLabel();
  JTextField addressTextField = new JTextField();
  JLabel birthLabel = new JLabel();
  JTextField birthTextField = new JTextField();
  JLabel idCardLabel = new JLabel();
  JTextField idCardTextField = new JTextField();
  JLabel contractLabel = new JLabel();
  JTextField contractTextField = new JTextField();
  JLabel contractBeginLabel = new JLabel();
  JTextField contractBeginTextField = new JTextField();
  JLabel exhibitionLabel = new JLabel();
  JTextField exhibitionTextField = new JTextField();
  JButton updateButton = new JButton();
  JButton deleteButton = new JButton();
  ButtonGroup buttonGroup1 = new ButtonGroup();
  public void updateButton_actionPerformed(ActionEvent e)
  {
    if(byEmpIdFrame!=null)
    {
      byEmpIdFrame.empInforTable.setValueAt(this.nameTextField.getText(),row,3);
      byEmpIdFrame.empInforTable.setValueAt(this.degreeComboBox.getSelectedItem(),row,4);
      String isMarry="未婚";
     if( this.marryRadioButton.isSelected())
       isMarry="已婚";
      byEmpIdFrame.empInforTable.setValueAt(isMarry,row,5);
      byEmpIdFrame.empInforTable.setValueAt(this.telTextField,row,6);
      byEmpIdFrame.empInforTable.setValueAt(this.addressTextField,row,7);
      byEmpIdFrame.empInforTable.setValueAt(this.birthTextField,row,8);
      this.dispose();
    }
    else if(byEmpNameFrame!=null)
    {
      byEmpNameFrame.employeeInforTable.setValueAt(this.nameTextField.getText(),row,3);
      byEmpNameFrame.employeeInforTable.setValueAt(this.degreeComboBox.getSelectedItem(),row,4);
      String isMarry="未婚";
     if( this.marryRadioButton.isSelected())
       isMarry="已婚";
      byEmpNameFrame.employeeInforTable.setValueAt(isMarry,row,5);
      byEmpNameFrame.employeeInforTable.setValueAt(this.telTextField,row,6);
      byEmpNameFrame.employeeInforTable.setValueAt(this.addressTextField,row,7);
      byEmpNameFrame.employeeInforTable.setValueAt(this.birthTextField,row,8);
      this.dispose();
    }
    else if(byDepIdFrame!=null)
    {
      byDepIdFrame.employeeInforTable.setValueAt(this.nameTextField.getText(),row,3);
      byDepIdFrame.employeeInforTable.setValueAt(this.degreeComboBox.getSelectedItem(),row,4);
      String isMarry="未婚";
     if( this.marryRadioButton.isSelected())
       isMarry="已婚";
      byDepIdFrame.employeeInforTable.setValueAt(isMarry,row,5);
      byDepIdFrame.employeeInforTable.setValueAt(this.telTextField,row,6);
      byDepIdFrame.employeeInforTable.setValueAt(this.addressTextField,row,7);
      byDepIdFrame.employeeInforTable.setValueAt(this.birthTextField,row,8);
      this.dispose();
    }
    else if(byJobIdFrame!=null)
    {
      byJobIdFrame.employeeInforTable.setValueAt(this.nameTextField.getText(),row,3);
      byJobIdFrame.employeeInforTable.setValueAt(this.degreeComboBox.getSelectedItem(),row,4);
      String isMarry="未婚";
     if( this.marryRadioButton.isSelected())
       isMarry="已婚";
      byJobIdFrame.employeeInforTable.setValueAt(isMarry,row,5);
      byJobIdFrame.employeeInforTable.setValueAt(this.telTextField,row,6);
      byJobIdFrame.employeeInforTable.setValueAt(this.addressTextField,row,7);
      byJobIdFrame.employeeInforTable.setValueAt(this.birthTextField,row,8);
      this.dispose();
    }
    else if(allFrame!=null)
    {
      allFrame.employeeInforTable.setValueAt(this.nameTextField.getText(),row,3);
      allFrame.employeeInforTable.setValueAt(this.degreeComboBox.getSelectedItem(),row,4);
      String isMarry="未婚";
     if( this.marryRadioButton.isSelected())
       isMarry="已婚";
      allFrame.employeeInforTable.setValueAt(isMarry,row,5);
      allFrame.employeeInforTable.setValueAt(this.telTextField,row,6);
      allFrame.employeeInforTable.setValueAt(this.addressTextField,row,7);
      allFrame.employeeInforTable.setValueAt(this.birthTextField,row,8);
      this.dispose();
    }




  }

  public void deleteButton_actionPerformed(ActionEvent e)
  {

  }
}

class EmployeeDetailInforDialog_deleteButton_actionAdapter
    implements ActionListener
{
  private EmployeeDetailInforDialog adaptee;
  EmployeeDetailInforDialog_deleteButton_actionAdapter(
      EmployeeDetailInforDialog adaptee)
  {
    this.adaptee = adaptee;
  }

  public void actionPerformed(ActionEvent e)
  {
    adaptee.deleteButton_actionPerformed(e);
  }
}

class EmployeeDetailInforDialog_updateButton_actionAdapter
    implements ActionListener
{
  private EmployeeDetailInforDialog adaptee;
  EmployeeDetailInforDialog_updateButton_actionAdapter(
      EmployeeDetailInforDialog adaptee)
  {
    this.adaptee = adaptee;
  }

  public void actionPerformed(ActionEvent e)
  {
    adaptee.updateButton_actionPerformed(e);
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -