为什么我查的数据在表中不显示。
public class Select_studentnoPanel extends JPanel {
public Select_studentnoPanel ()
{
try{
jbInit();
}catch(Exception exception)
{
exception.printStackTrace();
}
}
private void jbInit() throws Exception
{
this.setLayout(null);
this.setBackground(new Color(168,233,216));
button1.setBounds(new Rectangle(314,36,81,23));
button1.setText("退出");
button1.addActionListener(new Exit(this));
label1.setText("学生姓名");
label1.setBounds(new Rectangle(25,38,71,15));
button2.setBounds(new Rectangle(246,38,64,23));
button2.setText("查询");
button2.addActionListener(new Select_no(this));
tsno.setBounds(new Rectangle(108,38,126,20));
list.setBounds(new Rectangle(20,84,442,70));
this.add(button1);
this.add(label1);
this.add(button2);
this.add(tsno);
this.add(list);
this.setVisible(true);
this.setSize(600,600);
}
JButton button1=new JButton();
JButton button2=new JButton();
JLabel label1=new JLabel();
JTextField tsno=new JTextField();
JList list=new JList();
public void button1_actionPerformed(ActionEvent e)
{
this.setVisible(false);
}
public void button2_actionPerformed(ActionEvent e)
{
String sno=tsno.getText().trim();
GradeManager sm=new GradeManager();
Vector v=sm.findStudent(sno);
list.setListData(v);
}
}
class Select_no implements ActionListener
{
private Select_studentnoPanel adaptee;
Select_no(Select_studentnoPanel adaptee)
{
this.adaptee=adaptee;
}
public void actionPerformed(ActionEvent e)
{
adaptee.button2_actionPerformed(e);
}
}
class Exit implements ActionListener
{
private Select_studentnoPanel adaptee;
Exit(Select_studentnoPanel adaptee)
{
this.adaptee=adaptee;
}
public void actionPerformed(ActionEvent e)
{
adaptee.button1_actionPerformed(e);
}
}