Next active Frame losing focus bug fixed
authoramwaterhouse <Andrew Waterhouse>
Wed, 21 Sep 2005 17:07:57 +0000 (17:07 +0000)
committeramwaterhouse <Andrew Waterhouse>
Wed, 21 Sep 2005 17:07:57 +0000 (17:07 +0000)
src/jalview/gui/Desktop.java

index 99b24d3..037a7a9 100755 (executable)
@@ -187,6 +187,9 @@ public class Desktop extends jalview.jbgui.GDesktop
                 {
                     openFrameCount--;
                     windowMenu.remove(menuItem);
+                    JInternalFrame itf = desktop.getSelectedFrame();
+                       if (itf != null)
+                        itf.requestFocus();
                 }
                 ;
             });
@@ -364,17 +367,18 @@ public class Desktop extends jalview.jbgui.GDesktop
      */
     public void inputURLMenuItem_actionPerformed(ActionEvent e)
     {
-        String url = JOptionPane.showInternalInputDialog(Desktop.desktop,
+        Object reply = JOptionPane.showInternalInputDialog(Desktop.desktop,
                 "Enter url of input file", "Input alignment from URL",
-                JOptionPane.QUESTION_MESSAGE, null, null, "http://www.")
-                                .toString();
+                JOptionPane.QUESTION_MESSAGE, null, null, "http://www.");
 
-        if (url == null)
+        if (reply == null)
         {
             return;
         }
 
-        if (url.trim().toLowerCase().endsWith(".jar"))
+        String url = reply.toString().trim();
+
+        if (url.toLowerCase().endsWith(".jar"))
         {
                jalview.bin.Cache.setProperty("DEFAULT_FILE_FORMAT", "Jalview");
                Jalview2XML.LoadJalviewAlign(url);