为按钮jbselect增加监听:
jbselect.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
jchooser1 = new JFileChooser();<span style="white-space:pre"> </span>//JFileChooser控件
jchooser1.setCurrentDirectory(new File("c:/"));
int index = jchooser1.showOpenDialog(getContentPane());
if(index == JFileChooser.APPROVE_OPTION){
@SuppressWarnings("unused")
File selectedFile = jchooser1.getSelectedFile();
jtxdb.setText(jchooser1.getSelectedFile().getAbsolutePath());
dblist = ck.DBList(jtxdb.getText());
}
}
});