};
};
return false;
public bookTypeQMDIFrame() { }
private void initialize() { }
private JPanel getJContentPane() {
if (jContentPane == null) {
lbBookTypeDesc = new JLabel();
lbBookTypeDesc.setBounds(new Rectangle(8, 315, 67, 28)); lbBookTypeDesc.setText(\性别:\sexInput.setBounds(80, 315, 130, 26); brithday.setBounds(8, 355, 67, 28); brithInput.setBounds(80, 355, 130, 26); this.setBounds(new Rectangle(110, 20, 600, 580)); this.setTitle(\人员信息维护\this.setIconifiable(true); this.setClosable(true);
this.setContentPane(getJContentPane()); this.setVisible(true); super(); initialize();
address.setBounds(8, 390, 67, 28);
inputAdress.setBounds(80, 390, 130, 26); tel.setBounds(250, 315, 67, 28); inputTel.setBounds(335, 315, 130, 26); organization.setBounds(8, 432, 67, 28); organizationInput.setBounds(80, 432, 130, 26); position.setBounds(250, 355, 67, 28);
37
positionInput.setBounds(335, 355, 130, 26); Name = new JLabel();
Name.setBounds(new Rectangle(250, 280, 67, 28)); Name.setText(\姓名:\Id = new JLabel();
Id.setBounds(new Rectangle(7, 280, 68, 29)); Id.setText(\编号:\
lbSBookName = new JLabel();
lbSBookName.setBounds(new Rectangle(9, 58, 146, 25)); lbSBookName.setText(\请输入查询关键字:\lbTip = new JLabel(\人员信息查询\lbTip.setBounds(new Rectangle(0, 0, 600, 35)); lbTip.setFont(new Font(\黑体\jContentPane = new JPanel(); jContentPane.setLayout(null); jContentPane.add(lbTip, null); jContentPane.add(lbSBookName, null);
jContentPane.add(getTxtSBookTypeName(), null); jContentPane.add(sexInput, null); jContentPane.add(brithday, null); jContentPane.add(brithInput, null); jContentPane.add(address, null); jContentPane.add(inputAdress, null); jContentPane.add(getBtnQuery(), null); jContentPane.add(getScroll(), null); jContentPane.add(Id, null);
jContentPane.add(getTxtBookTypeId(), null); jContentPane.add(Name, null);
jContentPane.add(getTxtBookTypeName(), null); jContentPane.add(lbBookTypeDesc, null);
38
}
}
jContentPane.add(tel, null); jContentPane.add(inputTel, null); jContentPane.add(organization, null); jContentPane.add(organizationInput, null); jContentPane.add(position, null); jContentPane.add(positionInput, null); jContentPane.add(getBtnModify(), null); jContentPane.add(getBtnDelete(), null);
return jContentPane;
private JTextField getTxtSBookTypeName() { }
if (txtSBookTypeName == null) { }
return txtSBookTypeName;
txtSBookTypeName = new JTextField();
txtSBookTypeName.setBounds(new Rectangle(161, 57, 148, 29));
private JButton getBtnQuery() {
if (btnQuery == null) {
btnQuery = new JButton();
btnQuery.setBounds(new Rectangle(350, 58, 67, 25)); btnQuery.setText(\查询\
btnQuery.addActionListener(new ActionListener(){
private peopleInformation peopleinformation;
public void actionPerformed(ActionEvent arg0) {
String name=txtSBookTypeName.getText().trim();
peopleInformation booktype=new peopleInformation(name); model.setDataVector(new bookTypeQMDIFrame().getDatas(booktype),
39
new bookTypeQMDIFrame().getTitles());
}
}
});
}
return btnQuery;
private JScrollPane getScroll() { }
private JTable getTable() {
if (table == null) {
table = new JTable();
table.getTableHeader().setReorderingAllowed(false); table.getTableHeader().setResizingAllowed(false); table.setModel(model);
model.setDataVector(this.getDatas(new peopleInformation()), this.getTitles()); table.addMouseListener(new MouseAdapter(){
public void mouseClicked(MouseEvent e) {
int selectedRow=table.getSelectedRow();
int bookTypeId=(Integer)table.getValueAt(selectedRow, 0); String bookTypeName=(String)table.getValueAt(selectedRow, 1); String sex=(String)table.getValueAt(selectedRow, 2); String brith=(String)table.getValueAt(selectedRow, 3); String address=(String)table.getValueAt(selectedRow, 4); String tel=(String)table.getValueAt(selectedRow, 5); String organization=(String)table.getValueAt(selectedRow, 6);
40
if (scroll == null) { }
return scroll;
scroll = new JScrollPane();
scroll.setBounds(new Rectangle(5, 100, 580, 157)); scroll.setViewportView(getTable());
}
}
});
}
String position=(String)table.getValueAt(selectedRow, 7); txtBookTypeId.setText(Integer.toString(bookTypeId)); txtBookTypeName.setText(bookTypeName); sexInput.setText(sex); brithInput.setText(brith);
organizationInput.setText(organization); positionInput.setText(position); inputAdress.setText(address); inputTel.setText(tel);
return table;
private Vector getTitles() {
Vector v=new Vector(); v.add(\编号\v.add(\姓名\v.add(\性别\v.add(\出生日期\v.add(\家庭住址\v.add(\联系电话\v.add(\所加社团\v.add(\社团职务\return v;
}
private Vector getDatas(peopleInformation peopleinformation) {
return new BookTypeDao().getDatas(peopleinformation);
41