📄 selectallemployeeinforframe.java~3~
字号:
package employeemanagersystem;
import java.awt.*;
import javax.swing.*;
import java.awt.event.MouseEvent;
import java.awt.event.MouseAdapter;
/**
* <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));
mySql.initEmployeeInforByEmpIdTableModel(mtm, "", 5);
employeeInforTable = new JTable(mtm);
jScrollPane1.setBounds(new Rectangle(13, 67, 885, 197));
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 + -