public ReturnBook()
{
super("书籍还入");
c=getContentPane();
c.setLayout(new BorderLayout());
ReturnedBookStudentLabel=new JLabel("还书者姓名",JLabel.CENTER);
ReturnedBookNameLabel=new JLabel("书名",JLabel.CENTER);
ReturnedDateLabel=new JLabel("日期",JLabel.CENTER);
ReturnedBookStudentTextField=new JTextField(15);
ReturnedDateTextField=new JTextField(15);
try
{
String s="";
String strSQL="select bookName from bookBrowse where is_returned='否'";
rs=db.getResult(strSQL);
while(rs.next())
{
BookNameComboBox.addItem(rs.getString(1));
}
}
catch(SQLException sqle)
{
System.out.println(sqle.toString());
}
catch(Exception ex)
{
System.out.println(ex.toString());
}
panel1=new JPanel();
panel1.setLayout(new GridLayout(4,2));
panel1.add(ReturnedBookStudentLabel);
panel1.add(ReturnedBookStudentTextField);
panel1.add(ReturnedBookNameLabel);
panel1.add(BookNameComboBox);
panel1.add(ReturnedDateLabel);
panel1.add(ReturnedDateTextField);
c.add(panel1,BorderLayout.CENTER);
panel2=new JPanel();
panel2.setLayout(new GridLayout(1,3));
ClearBtn=new JButton("清空");
YesBtn=new JButton("确定");
CancelBtn=new JButton("取消");
ClearBtn.addActionListener(this);
YesBtn.addActionListener(this);
CancelBtn.addActionListener(this);
panel2.add(ClearBtn);
panel2.add(YesBtn);
panel2.add(CancelBtn);
c.add(panel2,BorderLayout.SOUTH);
}
public ReturnInfo()
{
super("修改书籍还入信息");
c=getContentPane();
c.setLayout(new BorderLayout());
c.add(TipLabel,BorderLayout.NORTH);
ReturnedBookStudentLabel=new JLabel("还书者姓名",JLabel.CENTER);
ReturnedBookNameLabel=new JLabel("书名",JLabel.CENTER);
ReturnedDateLabel=new JLabel("还书日期",JLabel.CENTER);
ReturnedBookStudentTextField=new JTextField(15);
ReturnedBookNameTextField=new JTextField(15);
ReturnedDateTextField=new JTextField(15);
panel1=new JPanel();
panel1.setLayout(new GridLayout(4,2));
panel1.add(ReturnedBookStudentLabel);
panel1.add(ReturnedBookStudentTextField);
panel1.add(ReturnedBookNameLabel);
panel1.add(ReturnedBookNameTextField);
panel1.add(ReturnedDateLabel);
panel1.add(ReturnedDateTextField);