X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FEditNameDialog.java;h=b6cc5a57ebe6363affe4f73452f20a3a8ef094a1;hb=7bc226b58110fa26d9dbd3f0c78095d06909ffc3;hp=2b1ee726c004345cd2451aaa3ba059e2b1deeb88;hpb=dd74fc4938723fe5ec48d4e5fdcfbe58ac42a48d;p=jalview.git diff --git a/src/jalview/gui/EditNameDialog.java b/src/jalview/gui/EditNameDialog.java index 2b1ee72..b6cc5a5 100644 --- a/src/jalview/gui/EditNameDialog.java +++ b/src/jalview/gui/EditNameDialog.java @@ -29,7 +29,6 @@ public class EditNameDialog JButton cancel = new JButton("Cancel"); boolean accept = false; - public String getName() { return id.getText(); @@ -38,9 +37,13 @@ public class EditNameDialog public String getDescription() { if (description.getText().length() < 1) + { return null; + } else + { return description.getText(); + } } public EditNameDialog(String name, @@ -49,7 +52,7 @@ public class EditNameDialog String label2, String title) { - JLabel idlabel = new JLabel( label1); + JLabel idlabel = new JLabel(label1); JLabel desclabel = new JLabel(label2); idlabel.setFont(new Font("Courier", Font.PLAIN, 12)); desclabel.setFont(new Font("Courier", Font.PLAIN, 12)); @@ -65,14 +68,13 @@ public class EditNameDialog panel2.add(description, BorderLayout.CENTER); panel.add(panel2, BorderLayout.SOUTH); - - int reply = JOptionPane.showInternalConfirmDialog(Desktop.desktop, + int reply = JOptionPane.showInternalConfirmDialog(Desktop.desktop, panel, title, - JOptionPane.OK_CANCEL_OPTION ); + JOptionPane.OK_CANCEL_OPTION); - if (reply == JOptionPane.OK_OPTION) - { - accept = true; - } + if (reply == JOptionPane.OK_OPTION) + { + accept = true; + } } }