+ ourselectedFile = getSelectedFile();
+
+ if (getSelectedFile() == null)
+ {
+ // Workaround for Java 9,10 on OSX - no selected file, but there is a
+ // filename typed in
+ try
+ {
+ String filename = ((BasicFileChooserUI) getUI()).getFileName();
+ if (filename != null && filename.length() > 0)
+ {
+ ourselectedFile = new File(getCurrentDirectory(), filename);
+ }
+ } catch (Throwable x)
+ {
+ System.err.println(
+ "Unexpected exception when trying to get filename.");
+ x.printStackTrace();
+ }
+ }
+ if (ourselectedFile == null)
+ {
+ returned = new Response(JalviewFileChooser.CANCEL_OPTION);
+ return;
+ }