【发布时间】:2016-05-01 05:27:41
【问题描述】:
我的代码:
JFileChooser dialog = new JFileChooser();
dialog.showOpenDialog(rootPane);
dialog.setMultiSelectionEnabled(true);
dialog.setFileFilter(new FileFilter() {
@Override
public String getDescription() {
// TODO Auto-generated method stub
return null;
}
@Override
public boolean accept(File arg0) {
return arg0.getAbsolutePath().endsWith("png")||
arg0.getAbsolutePath().endsWith("jpg");
}
});
File[] file = dialog.getSelectedFiles();
程序运行时,我不能选择超过1个文件。
【问题讨论】:
-
请创建并发布一个小而简单的完整程序来说明您的问题,MCVE。请查看链接了解这个非常有用的工具的详细信息。
标签: java jfilechooser