summaryrefslogtreecommitdiff
path: root/javax/swing/JOptionPane.java
diff options
context:
space:
mode:
authorAndrew John Hughes <gnu_andrew@member.fsf.org>2005-11-27 21:00:34 +0000
committerAndrew John Hughes <gnu_andrew@member.fsf.org>2005-11-27 21:00:34 +0000
commit15ee25b923180850794e71cc44c9859e65eea8a2 (patch)
tree5115c5c9f0dacfbeb537decc2bcb25ef362e039f /javax/swing/JOptionPane.java
parent6f383d9c78e81a535c35c5e69df90cd5a4d1dbfa (diff)
downloadclasspath-15ee25b923180850794e71cc44c9859e65eea8a2.tar.gz
2005-11-27 Andrew John Hughes <gnu_andrew@member.fsf.org>
* Merge of HEAD --> generics from the release of Classpath 0.19 to 2005/11/27.
Diffstat (limited to 'javax/swing/JOptionPane.java')
-rw-r--r--javax/swing/JOptionPane.java24
1 files changed, 3 insertions, 21 deletions
diff --git a/javax/swing/JOptionPane.java b/javax/swing/JOptionPane.java
index 2f28ccc91..057326cd2 100644
--- a/javax/swing/JOptionPane.java
+++ b/javax/swing/JOptionPane.java
@@ -369,15 +369,12 @@ public class JOptionPane extends JComponent implements Accessible
inputValue = UNINITIALIZED_VALUE;
value = UNINITIALIZED_VALUE;
- // FIXME: This dialog should be centered on the parent
- // or at the center of the screen (if the parent is null)
- // Need getGraphicsConfiguration to return non-null in
- // order for that to work so we know how large the
- // screen is.
dialog.getContentPane().add(this);
dialog.setModal(true);
dialog.setResizable(false);
-
+ dialog.pack();
+ dialog.setLocationRelativeTo(parentComponent);
+
return dialog;
}
@@ -860,8 +857,6 @@ public class JOptionPane extends JComponent implements Accessible
{
JOptionPane pane = new JOptionPane(message, QUESTION_MESSAGE);
JDialog dialog = pane.createDialog(parentComponent, "Select an Option");
-
- dialog.pack();
dialog.show();
if (pane.getValue() instanceof Integer)
@@ -888,7 +883,6 @@ public class JOptionPane extends JComponent implements Accessible
{
JOptionPane pane = new JOptionPane(message, PLAIN_MESSAGE, optionType);
JDialog dialog = pane.createDialog(parentComponent, title);
- dialog.pack();
dialog.show();
if (pane.getValue() instanceof Integer)
@@ -916,7 +910,6 @@ public class JOptionPane extends JComponent implements Accessible
{
JOptionPane pane = new JOptionPane(message, messageType, optionType);
JDialog dialog = pane.createDialog(parentComponent, title);
- dialog.pack();
dialog.show();
if (pane.getValue() instanceof Integer)
@@ -946,7 +939,6 @@ public class JOptionPane extends JComponent implements Accessible
{
JOptionPane pane = new JOptionPane(message, messageType, optionType, icon);
JDialog dialog = pane.createDialog(parentComponent, title);
- dialog.pack();
dialog.show();
if (pane.getValue() instanceof Integer)
@@ -972,7 +964,6 @@ public class JOptionPane extends JComponent implements Accessible
JOptionPane pane = new JOptionPane(message, QUESTION_MESSAGE);
pane.setWantsInput(true);
JDialog dialog = pane.createDialog(parentComponent, null);
- dialog.pack();
dialog.show();
return (String) pane.getInputValue();
@@ -999,7 +990,6 @@ public class JOptionPane extends JComponent implements Accessible
pane.setInitialSelectionValue(initialSelectionValue);
pane.setWantsInput(true);
JDialog dialog = pane.createDialog(parentComponent, null);
- dialog.pack();
dialog.show();
return (String) pane.getInputValue();
@@ -1025,7 +1015,6 @@ public class JOptionPane extends JComponent implements Accessible
JOptionPane pane = new JOptionPane(message, messageType);
pane.setWantsInput(true);
JDialog dialog = pane.createDialog(parentComponent, title);
- dialog.pack();
dialog.show();
return (String) pane.getInputValue();
@@ -1058,7 +1047,6 @@ public class JOptionPane extends JComponent implements Accessible
pane.setSelectionValues(selectionValues);
pane.setInitialSelectionValue(initialSelectionValue);
JDialog dialog = pane.createDialog(parentComponent, title);
- dialog.pack();
dialog.show();
return pane.getInputValue();
@@ -1079,7 +1067,6 @@ public class JOptionPane extends JComponent implements Accessible
JOptionPane pane = new JOptionPane(message, QUESTION_MESSAGE);
pane.setWantsInput(true);
JDialog dialog = pane.createDialog(null, null);
- dialog.pack();
dialog.show();
return (String) pane.getInputValue();
@@ -1104,7 +1091,6 @@ public class JOptionPane extends JComponent implements Accessible
pane.setWantsInput(true);
pane.setInitialSelectionValue(initialSelectionValue);
JDialog dialog = pane.createDialog(null, null);
- dialog.pack();
dialog.show();
return (String) pane.getInputValue();
@@ -1409,7 +1395,6 @@ public class JOptionPane extends JComponent implements Accessible
{
JOptionPane pane = new JOptionPane(message, INFORMATION_MESSAGE);
JDialog dialog = pane.createDialog(parentComponent, null);
- dialog.pack();
dialog.show();
}
@@ -1428,7 +1413,6 @@ public class JOptionPane extends JComponent implements Accessible
{
JOptionPane pane = new JOptionPane(message, messageType);
JDialog dialog = pane.createDialog(parentComponent, title);
- dialog.pack();
dialog.show();
}
@@ -1449,7 +1433,6 @@ public class JOptionPane extends JComponent implements Accessible
JOptionPane pane = new JOptionPane(message, messageType);
pane.setIcon(icon);
JDialog dialog = pane.createDialog(parentComponent, title);
- dialog.pack();
dialog.show();
}
@@ -1479,7 +1462,6 @@ public class JOptionPane extends JComponent implements Accessible
options, initialValue);
JDialog dialog = pane.createDialog(parentComponent, title);
- dialog.pack();
dialog.show();
if (pane.getValue() instanceof Integer)