summaryrefslogtreecommitdiff
path: root/javax/swing/Popup.java
diff options
context:
space:
mode:
authorLillian Angel <langel@redhat.com>2005-11-04 18:47:44 +0000
committerLillian Angel <langel@redhat.com>2005-11-04 18:47:44 +0000
commit86885b30d7991cfbc6a4bdda801c32e14adb9f9b (patch)
tree998c3f65d0c1f53965e19bbe75f6787c33acb064 /javax/swing/Popup.java
parent33f0da3cda03bdaa572f70c0cb81ea260ca4f01f (diff)
downloadclasspath-86885b30d7991cfbc6a4bdda801c32e14adb9f9b.tar.gz
2005-11-04 Lillian Angel <langel@redhat.com>
* javax/swing/plaf/basic/BasicMenuItemUI.java (paintMenuItem): Changed to use isTopLevelMenu rather than checking instance of parent. * javax/swing/plaf/basic/BasicPopupMenuUI.java (popupMenuWillBecomeInvisible): Added check to prevent NPE. * javax/swing/Popup.java: Added new private field. (LightweightPopup): Initialized layeredPane. (show): Removed unneeded code. (hide): Likewise.
Diffstat (limited to 'javax/swing/Popup.java')
-rw-r--r--javax/swing/Popup.java15
1 files changed, 10 insertions, 5 deletions
diff --git a/javax/swing/Popup.java b/javax/swing/Popup.java
index 5b2615d2f..d7e89b5ae 100644
--- a/javax/swing/Popup.java
+++ b/javax/swing/Popup.java
@@ -224,7 +224,12 @@ public class Popup
* The panel that holds the content.
*/
private JPanel panel;
-
+
+ /**
+ * The layered pane of the owner.
+ */
+ private JLayeredPane layeredPane;
+
/**
* Constructs a new <code>LightweightPopup</code> given its owner,
* contents and the screen position where the popup
@@ -252,6 +257,10 @@ public class Popup
this.contents = contents;
this.x = x;
this.y = y;
+
+ JRootPane rootPane = SwingUtilities.getRootPane(owner);
+ JLayeredPane layeredPane = rootPane.getLayeredPane();
+ this.layeredPane = layeredPane;
}
/**
@@ -260,8 +269,6 @@ public class Popup
*/
public void show()
{
- JRootPane rootPane = SwingUtilities.getRootPane(owner);
- JLayeredPane layeredPane = rootPane.getLayeredPane();
// We insert a JPanel between the layered pane and the contents so we
// can fiddle with the setLocation() method without disturbing a
// JPopupMenu (which overrides setLocation in an unusual manner).
@@ -282,8 +289,6 @@ public class Popup
*/
public void hide()
{
- JRootPane rootPane = SwingUtilities.getRootPane(owner);
- JLayeredPane layeredPane = rootPane.getLayeredPane();
layeredPane.remove(panel);
}
}