private AbstractAction getxxxabstractAction() {
if(xxxabstractAction == null) {
xxxabstractAction = new AbstractAction("Choose", null) {
public void actionPerformed(ActionEvent evt) {
getFileChooser1().setVisible(true);
getFileChooser1().setLocation(null);
}
};
}
return xxxabstractAction;
}
我是用esclipe的GUI..想经一个主介面的一个按键去开一个jfilechooser 但是不管怎样也出error
解决方案 »
- 请问抽象类与接口的具体区别是什么呀?
- Proxool 在C\S下怎么配置?
- 为什么我做的JAVA程序可以和数据连接但连接后写入表中的数据相当于没写是怎么回事?
- 如何使程序在开机时候自动运行?
- 邮编城市
- 帮我分析一下几行代码~~~~~
- 请问如何用java实现c++中的指针功能??
- How to append two arrays without copying characters???
- [Eclipse]checkstyle-3.1如何安装?
- 请问:Statement、CallableStatement、PreparedStatement有什么区别?
- 请教2个正则表达式怎么写
- 关于GUI的使用方法
@Override
public void actionPerformed(ActionEvent e) {
// 选择文件夹
final JFileChooser chooser = new JFileChooser();
chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
int result = chooser.showOpenDialog(PathTree.this); if (result == JFileChooser.APPROVE_OPTION) {
Thread t = new Thread(new Runnable() {
@Override
public void run() {
File dir = chooser.getSelectedFile();
pathsTextArea.setText("");
stopped = false;
walkTree(dir, 0);
}
});
t.start();
}
}
});