Make URL input window bigger
authoramwaterhouse <Andrew Waterhouse>
Wed, 8 Feb 2006 15:26:11 +0000 (15:26 +0000)
committeramwaterhouse <Andrew Waterhouse>
Wed, 8 Feb 2006 15:26:11 +0000 (15:26 +0000)
src/jalview/gui/Desktop.java

index 6295801..a60d4e7 100755 (executable)
@@ -391,16 +391,26 @@ public class Desktop extends jalview.jbgui.GDesktop
      */
     public void inputURLMenuItem_actionPerformed(ActionEvent e)
     {
-        Object reply = JOptionPane.showInternalInputDialog(Desktop.desktop,
-                "Enter url of input file", "Input alignment from URL",
-                JOptionPane.QUESTION_MESSAGE, null, null, "http://www.");
+      // This construct allows us to have a wider textfield
+      // for viewing
+      JLabel label = new JLabel("Enter URL of Input File");
+      JTextField textinput = new JTextField("http://www.", 40);
+      JPanel panel = new JPanel(new BorderLayout());
+      panel.add(label, BorderLayout.NORTH);
+      panel.add(textinput, BorderLayout.SOUTH);
 
-        if (reply == null)
+
+       int reply = JOptionPane.showInternalConfirmDialog(desktop,
+          panel, "Input Alignment From URL",
+          JOptionPane.OK_CANCEL_OPTION );
+
+
+        if (reply != JOptionPane.OK_OPTION )
         {
             return;
         }
 
-        String url = reply.toString().trim();
+        String url = textinput.getText();
 
         if (url.toLowerCase().endsWith(".jar"))
         {