JOptionPanes should be set to a location relative to their parent.
2005-11-07 Lillian Angel <[EMAIL PROTECTED]>
* javax/swing/JOptionPane.java
(showConfirmDialog): Added call to set the location of the
dialog relative to its parent.
(showConfirmDialog): Likewise.
(showConfirmDialog): Likewise.
(showConfirmDialog): Likewise.
(showInputDialog): Likewise.
(showInputDialog): Likewise.
(showInputDialog): Likewise.
(showInputDialog): Likewise.
(showMessageDialog): Likewise.
(showMessageDialog): Likewise.
(showMessageDialog): Likewise.
(showOptionDialog): Likewise.
Index: javax/swing/JOptionPane.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/JOptionPane.java,v
retrieving revision 1.21
diff -u -r1.21 JOptionPane.java
--- javax/swing/JOptionPane.java 19 Oct 2005 15:45:04 -0000 1.21
+++ javax/swing/JOptionPane.java 7 Nov 2005 15:34:18 -0000
@@ -862,6 +862,7 @@
JDialog dialog = pane.createDialog(parentComponent, "Select an Option");
dialog.pack();
+ dialog.setLocationRelativeTo(parentComponent);
dialog.show();
if (pane.getValue() instanceof Integer)
@@ -889,6 +890,7 @@
JOptionPane pane = new JOptionPane(message, PLAIN_MESSAGE, optionType);
JDialog dialog = pane.createDialog(parentComponent, title);
dialog.pack();
+ dialog.setLocationRelativeTo(parentComponent);
dialog.show();
if (pane.getValue() instanceof Integer)
@@ -917,6 +919,7 @@
JOptionPane pane = new JOptionPane(message, messageType, optionType);
JDialog dialog = pane.createDialog(parentComponent, title);
dialog.pack();
+ dialog.setLocationRelativeTo(parentComponent);
dialog.show();
if (pane.getValue() instanceof Integer)
@@ -947,6 +950,7 @@
JOptionPane pane = new JOptionPane(message, messageType, optionType, icon);
JDialog dialog = pane.createDialog(parentComponent, title);
dialog.pack();
+ dialog.setLocationRelativeTo(parentComponent);
dialog.show();
if (pane.getValue() instanceof Integer)
@@ -973,6 +977,7 @@
pane.setWantsInput(true);
JDialog dialog = pane.createDialog(parentComponent, null);
dialog.pack();
+ dialog.setLocationRelativeTo(parentComponent);
dialog.show();
return (String) pane.getInputValue();
@@ -1000,6 +1005,7 @@
pane.setWantsInput(true);
JDialog dialog = pane.createDialog(parentComponent, null);
dialog.pack();
+ dialog.setLocationRelativeTo(parentComponent);
dialog.show();
return (String) pane.getInputValue();
@@ -1026,6 +1032,7 @@
pane.setWantsInput(true);
JDialog dialog = pane.createDialog(parentComponent, title);
dialog.pack();
+ dialog.setLocationRelativeTo(parentComponent);
dialog.show();
return (String) pane.getInputValue();
@@ -1059,6 +1066,7 @@
pane.setInitialSelectionValue(initialSelectionValue);
JDialog dialog = pane.createDialog(parentComponent, title);
dialog.pack();
+ dialog.setLocationRelativeTo(parentComponent);
dialog.show();
return pane.getInputValue();
@@ -1410,6 +1418,7 @@
JOptionPane pane = new JOptionPane(message, INFORMATION_MESSAGE);
JDialog dialog = pane.createDialog(parentComponent, null);
dialog.pack();
+ dialog.setLocationRelativeTo(parentComponent);
dialog.show();
}
@@ -1429,6 +1438,7 @@
JOptionPane pane = new JOptionPane(message, messageType);
JDialog dialog = pane.createDialog(parentComponent, title);
dialog.pack();
+ dialog.setLocationRelativeTo(parentComponent);
dialog.show();
}
@@ -1450,6 +1460,7 @@
pane.setIcon(icon);
JDialog dialog = pane.createDialog(parentComponent, title);
dialog.pack();
+ dialog.setLocationRelativeTo(parentComponent);
dialog.show();
}
@@ -1480,6 +1491,7 @@
JDialog dialog = pane.createDialog(parentComponent, title);
dialog.pack();
+ dialog.setLocationRelativeTo(parentComponent);
dialog.show();
if (pane.getValue() instanceof Integer)
_______________________________________________
Classpath-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath-patches