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

📄 selectallemployeeinforframe.java

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

import java.awt.*;
import javax.swing.*;
import java.awt.event.MouseEvent;
import java.awt.event.MouseAdapter;
import java.util.Vector;
import java.awt.Rectangle;

/**
 * <p>Title: </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2007</p>
 *
 * <p>Company: </p>
 *
 * @author not attributable
 * @version 1.0
 */
public class SelectAllEmployeeInforFrame
    extends JFrame
{
  public SelectAllEmployeeInforFrame()
  {
    try
    {
      jbInit();
    }
    catch (Exception exception)
    {
      exception.printStackTrace();
    }
  }

  private void jbInit()
      throws Exception
  {
    getContentPane().setLayout(null);
    noticeLabel.setFont(new java.awt.Font("宋体", Font.PLAIN, 20));
    noticeLabel.setText("所  有  员  工  信  息  如  下:");
    noticeLabel.setBounds(new Rectangle(274, 11, 347, 44));
    Vector infor = mySql.initEmployeeInforByEmpIdTableModel("", 5);
    int row = infor.size();
    String content[][] = new String[row][13];
    String head[] =
        {
        "编号", "部门", "工种", "姓名", "学历", "婚否", "电话", "地址", "出生年月", "身 份 证 号",
        "合同期限", "合同生效时间", "工作表现"};

    for (int i = 0; i < row; i++)
    {
      EmployeeDetailInformation edi = (EmployeeDetailInformation) infor.
          elementAt(i);
      content[i][0] = edi.getEmpId();
      content[i][1] = edi.getDepNamed();
      content[i][2] = edi.getJobName();
      content[i][3] = edi.getName();
      content[i][4] = edi.getDegree();
      content[i][5] = edi.getMarryStr();
      content[i][6] = edi.getTel();
      content[i][7] = edi.getAddress();
      content[i][8] = edi.getBirth();
      content[i][9] = edi.getIdCard();
      content[i][10] = "" + edi.getContractTime();
      content[i][11] = edi.getBeginTime();
      content[i][12] = edi.getExhibitionStr();

    }
    mtm = new MyTableModel(head, content);

    employeeInforTable = new JTable(mtm);
    jScrollPane1.setBounds(new Rectangle(15, 53, 893, 230));
    employeeInforTable.addMouseListener(new
                                        SelectAllEmployeeInforFrame_employeeInforTable_mouseAdapter(this));
    this.setTitle("查询所有员工信息");
    this.add(noticeLabel);
    this.add(jScrollPane1);
    jScrollPane1.getViewport().add(employeeInforTable);

  }

  SQLClass mySql = new SQLClass();
  MyTableModel mtm = new MyTableModel();
  JLabel noticeLabel = new JLabel();
  JScrollPane jScrollPane1 = new JScrollPane();
  JTable employeeInforTable = new JTable();
  public void employeeInforTable_mouseClicked(MouseEvent e)
  {
    int row = this.employeeInforTable.rowAtPoint(e.getPoint());
    EmployeeDetailInforDialog detailDialog = new EmployeeDetailInforDialog(this,
        "编辑员工信息", true, row);
    detailDialog.empIdTextField.setText( (String) employeeInforTable.getValueAt(
        row, 0));
    detailDialog.depNameTextField.setText( (String) employeeInforTable.
                                          getValueAt(
                                              row, 1));
    detailDialog.jobTextField.setText( (String) employeeInforTable.getValueAt(
        row,
        2));
    detailDialog.nameTextField.setText( (String) employeeInforTable.getValueAt(
        row,
        3));
    detailDialog.degreeComboBox.setSelectedItem(employeeInforTable.getValueAt(
        row,
        4).toString().trim());
    if (employeeInforTable.getValueAt(row, 5).toString().trim().equals("已婚"))
    {
      detailDialog.marryRadioButton.setSelected(true);
    }
    else
    {
      detailDialog.notMarryRadioButton.setSelected(true);
    }
    detailDialog.telTextField.setText( (String) employeeInforTable.getValueAt(
        row,
        6));
    detailDialog.addressTextField.setText( (String) employeeInforTable.
                                          getValueAt(
                                              row, 7));
    detailDialog.birthTextField.setText( (String) employeeInforTable.getValueAt(
        row, 8));
    detailDialog.idCardTextField.setText( (String) employeeInforTable.
                                         getValueAt(
                                             row, 9));
    detailDialog.contractTextField.setText( (String) employeeInforTable.
                                           getValueAt(
                                               row, 10));
    detailDialog.contractBeginTextField.setText( (String) employeeInforTable.
                                                getValueAt(row, 11));
    detailDialog.exhibitionTextField.setText( (String) employeeInforTable.
                                             getValueAt(row, 12));
    detailDialog.setBounds(120, 120, 750, 500);
    detailDialog.setResizable(false);
    detailDialog.setVisible(true);
  }

}

class SelectAllEmployeeInforFrame_employeeInforTable_mouseAdapter
    extends MouseAdapter
{
  private SelectAllEmployeeInforFrame adaptee;
  SelectAllEmployeeInforFrame_employeeInforTable_mouseAdapter(
      SelectAllEmployeeInforFrame adaptee)
  {
    this.adaptee = adaptee;
  }

  public void mouseClicked(MouseEvent e)
  {
    adaptee.employeeInforTable_mouseClicked(e);
  }
}

⌨️ 快捷键说明

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