Allow for frame insets
authoramwaterhouse <Andrew Waterhouse>
Tue, 6 Feb 2007 15:51:07 +0000 (15:51 +0000)
committeramwaterhouse <Andrew Waterhouse>
Tue, 6 Feb 2007 15:51:07 +0000 (15:51 +0000)
src/jalview/appletgui/EditNameDialog.java

index b80aca7..56dcbc3 100644 (file)
@@ -55,11 +55,15 @@ public class EditNameDialog extends Dialog implements ActionListener
     description = new TextField(desc, 40);\r
     Panel panel = new Panel(new BorderLayout());\r
     Panel panel2 = new Panel(new BorderLayout());\r
-    panel2.add(new Label(label1), BorderLayout.WEST);\r
+    Label label = new Label(label1);\r
+    label.setFont(new Font("Monospaced",Font.PLAIN, 12));\r
+    panel2.add(label, BorderLayout.WEST);\r
     panel2.add(id, BorderLayout.CENTER);\r
     panel.add(panel2, BorderLayout.NORTH);\r
     panel2 = new Panel(new BorderLayout());\r
-    panel2.add(new Label(label2), BorderLayout.WEST);\r
+    label = new Label(label2);\r
+    label.setFont(new Font("Monospaced",Font.PLAIN, 12));\r
+    panel2.add(label, BorderLayout.WEST);\r
     panel2.add(description, BorderLayout.CENTER);\r
     panel.add(panel2, BorderLayout.CENTER);\r
 \r
@@ -74,13 +78,22 @@ public class EditNameDialog extends Dialog implements ActionListener
 \r
     add(panel, BorderLayout.NORTH);\r
 \r
+\r
+    int width = 500, height=100;\r
+\r
+    pack();\r
+\r
+    height+=getInsets().top+getInsets().bottom;\r
+\r
     setBounds(ap.alignFrame.getBounds().x\r
-              + (ap.alignFrame.getSize().width - 500) / 2,\r
+              + (ap.alignFrame.getSize().width - width) / 2,\r
               ap.alignFrame.getBounds().y\r
-              + (ap.alignFrame.getSize().height - 120) / 2,\r
-              500, 130);\r
+              + (ap.alignFrame.getSize().height - height) / 2,\r
+              width, height);\r
 \r
     show();\r
+\r
+\r
   }\r
 \r
   public void actionPerformed(ActionEvent evt)\r