From: Jim Procter Date: Mon, 21 Apr 2014 17:13:56 +0000 (+0100) Subject: fix for JAL-1438 X-Git-Tag: Jalview_2_9~197^2~3 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=35a66e003e7fc9ef05d963a0a310d279b4e1e161;p=jalview.git fix for JAL-1438 --- diff --git a/src/jalview/io/JalviewFileChooser.java b/src/jalview/io/JalviewFileChooser.java index e9651ad..46ecf41 100755 --- a/src/jalview/io/JalviewFileChooser.java +++ b/src/jalview/io/JalviewFileChooser.java @@ -215,22 +215,24 @@ public class JalviewFileChooser extends JFileChooser return ret; } - void recentListSelectionChanged(String selection) + void recentListSelectionChanged(Object selection) { setSelectedFile(null); - - File file = new File(selection); - if (getFileFilter() instanceof JalviewFileFilter) + if (selection != null) { - JalviewFileFilter jvf = (JalviewFileFilter) this.getFileFilter(); - - if (!jvf.accept(file)) + File file = new File((String) selection); + if (getFileFilter() instanceof JalviewFileFilter) { - setFileFilter(getChoosableFileFilters()[0]); + JalviewFileFilter jvf = (JalviewFileFilter) this.getFileFilter(); + + if (!jvf.accept(file)) + { + setFileFilter(getChoosableFileFilters()[0]); + } } - } - setSelectedFile(file); + setSelectedFile(file); + } } class RecentlyOpened extends JPanel @@ -263,7 +265,7 @@ public class JalviewFileChooser extends JFileChooser { public void mousePressed(MouseEvent evt) { - recentListSelectionChanged(list.getSelectedValue().toString()); + recentListSelectionChanged(list.getSelectedValue()); } });