|
|
@@ -23,6 +23,7 @@ public class SetImageAction extends MouseAdapter {
|
|
|
private static class ImageFileFilter extends FileFilter {
|
|
|
@Override
|
|
|
public boolean accept(File f) {
|
|
|
+ if (f.isDirectory()) { return true; }
|
|
|
final String ext = Stream.of(f.getAbsolutePath())
|
|
|
.filter(p -> p.contains("."))
|
|
|
.map(p -> p.substring(p.lastIndexOf(".") + 1))
|
|
|
@@ -42,7 +43,7 @@ public class SetImageAction extends MouseAdapter {
|
|
|
if (model == null || e.getClickCount() != 2) { return; }
|
|
|
|
|
|
final JFileChooser chooser = new JFileChooser("./");
|
|
|
- chooser.addChoosableFileFilter(new ImageFileFilter());
|
|
|
+ chooser.setFileFilter(new ImageFileFilter());
|
|
|
if (chooser.showOpenDialog(e.getComponent()) != JFileChooser.APPROVE_OPTION) {
|
|
|
return;
|
|
|
}
|