From 86011b0050bef180a47dc4bb764cc97dc3a1b33c Mon Sep 17 00:00:00 2001 From: Roman Kennke Date: Thu, 19 Jan 2006 22:27:27 +0000 Subject: 2006-01-19 Roman Kennke * javax/swing/JWindow.java (JWindow(Window)): Fixed to accept null owner argument. (JWindow(Window,GraphicsConfiguration)): Fixed to accept null owner argument. * javax/swing/SwingUtilities.java (getOwnerFrame): Owner parameter and return value are fixed to be of type Window for compatibity with the above JWindow constructor. * javax/swing/JDialog.java (JDialog): Added cast to Frame to make sure the correct constructor is called. * javax/swing/JFileChooser.java (createDialog): Added cast to Frame for JDialog constructor. --- ChangeLog | 16 ++++++++++++++++ javax/swing/JDialog.java | 4 ++-- javax/swing/JFileChooser.java | 2 +- javax/swing/JWindow.java | 4 ++-- javax/swing/SwingUtilities.java | 4 ++-- 5 files changed, 23 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8d8b55414..9068ea9c3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2006-01-19 Roman Kennke + + * javax/swing/JWindow.java + (JWindow(Window)): Fixed to accept null owner argument. + (JWindow(Window,GraphicsConfiguration)): Fixed to accept null + owner argument. + * javax/swing/SwingUtilities.java + (getOwnerFrame): Owner parameter and return value are fixed to + be of type Window for compatibity with the above JWindow + constructor. + * javax/swing/JDialog.java + (JDialog): Added cast to Frame to make sure the correct constructor + is called. + * javax/swing/JFileChooser.java + (createDialog): Added cast to Frame for JDialog constructor. + 2006-01-19 Audrius Meskauskas * javax/swing/JTable.java (rowAtPoint): Rewritten. diff --git a/javax/swing/JDialog.java b/javax/swing/JDialog.java index f1305aad4..d8d395a29 100644 --- a/javax/swing/JDialog.java +++ b/javax/swing/JDialog.java @@ -107,7 +107,7 @@ public class JDialog extends Dialog implements Accessible, WindowConstants, */ public JDialog() { - this(SwingUtilities.getOwnerFrame(null), "", false, null); + this((Frame) SwingUtilities.getOwnerFrame(null), "", false, null); } /** @@ -234,7 +234,7 @@ public class JDialog extends Dialog implements Accessible, WindowConstants, public JDialog(Frame owner, String title, boolean modal, GraphicsConfiguration gc) { - super(SwingUtilities.getOwnerFrame(owner), title, modal, gc); + super((Frame) SwingUtilities.getOwnerFrame(owner), title, modal, gc); dialogInit(); } diff --git a/javax/swing/JFileChooser.java b/javax/swing/JFileChooser.java index a7ef1e760..72bd2bb28 100644 --- a/javax/swing/JFileChooser.java +++ b/javax/swing/JFileChooser.java @@ -725,7 +725,7 @@ public class JFileChooser extends JComponent implements Accessible { Frame toUse = (Frame) SwingUtilities.getAncestorOfClass(Frame.class, parent); if (toUse == null) - toUse = SwingUtilities.getOwnerFrame(null); + toUse = (Frame) SwingUtilities.getOwnerFrame(null); JDialog dialog = new JDialog(toUse); setSelectedFile(null); diff --git a/javax/swing/JWindow.java b/javax/swing/JWindow.java index b4852542c..8fffd9d52 100644 --- a/javax/swing/JWindow.java +++ b/javax/swing/JWindow.java @@ -133,7 +133,7 @@ public class JWindow extends Window implements Accessible, RootPaneContainer */ public JWindow(Window owner) { - super(owner); + super(SwingUtilities.getOwnerFrame(owner)); windowInit(); } @@ -152,7 +152,7 @@ public class JWindow extends Window implements Accessible, RootPaneContainer */ public JWindow(Window owner, GraphicsConfiguration gc) { - super(owner, gc); + super(SwingUtilities.getOwnerFrame(owner), gc); windowInit(); } diff --git a/javax/swing/SwingUtilities.java b/javax/swing/SwingUtilities.java index bba27a289..af4ae040a 100644 --- a/javax/swing/SwingUtilities.java +++ b/javax/swing/SwingUtilities.java @@ -1021,9 +1021,9 @@ public class SwingUtilities * * @return The common Frame */ - static Frame getOwnerFrame(Frame owner) + static Window getOwnerFrame(Window owner) { - Frame result = owner; + Window result = owner; if (result == null) { if (ownerFrame == null) -- cgit v1.2.1