aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbagiras <none@none>2013-11-26 15:57:49 +0400
committerbagiras <none@none>2013-11-26 15:57:49 +0400
commit08cdc624b23c381a4e6a43cb5706788efdc1bdab (patch)
treea9732feac0919ff5d71e8c4fc4c0887ec1b43b7a /src
parent598d58826203cd1bd70dd8f2e0d64c1dab704205 (diff)
7160604: Using non-opaque windows - popups are initially not painted correctly
Reviewed-by: serb, alexsch
Diffstat (limited to 'src')
-rw-r--r--src/share/classes/javax/swing/JPopupMenu.java16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/share/classes/javax/swing/JPopupMenu.java b/src/share/classes/javax/swing/JPopupMenu.java
index 0967ebaf5..4112de64d 100644
--- a/src/share/classes/javax/swing/JPopupMenu.java
+++ b/src/share/classes/javax/swing/JPopupMenu.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -736,7 +736,7 @@ public class JPopupMenu extends JComponent implements Accessible,MenuElement {
if (pref == null || pref.width != getWidth() ||
pref.height != getHeight()) {
- popup = getPopup();
+ showPopup();
} else {
validate();
}
@@ -787,7 +787,7 @@ public class JPopupMenu extends JComponent implements Accessible,MenuElement {
if(b) {
firePopupMenuWillBecomeVisible();
- popup = getPopup();
+ showPopup();
firePropertyChange("visible", Boolean.FALSE, Boolean.TRUE);
@@ -805,7 +805,7 @@ public class JPopupMenu extends JComponent implements Accessible,MenuElement {
}
/**
- * Returns a <code>Popup</code> instance from the
+ * Retrieves <code>Popup</code> instance from the
* <code>PopupMenuUI</code> that has had <code>show</code> invoked on
* it. If the current <code>popup</code> is non-null,
* this will invoke <code>dispose</code> of it, and then
@@ -814,7 +814,7 @@ public class JPopupMenu extends JComponent implements Accessible,MenuElement {
* This does NOT fire any events, it is up the caller to dispatch
* the necessary events.
*/
- private Popup getPopup() {
+ private void showPopup() {
Popup oldPopup = popup;
if (oldPopup != null) {
@@ -838,8 +838,8 @@ public class JPopupMenu extends JComponent implements Accessible,MenuElement {
desiredLocationY);
popupFactory.setPopupType(PopupFactory.LIGHT_WEIGHT_POPUP);
+ popup = newPopup;
newPopup.show();
- return newPopup;
}
/**
@@ -873,7 +873,7 @@ public class JPopupMenu extends JComponent implements Accessible,MenuElement {
desiredLocationX = x;
desiredLocationY = y;
if(popup != null && (x != oldX || y != oldY)) {
- popup = getPopup();
+ showPopup();
}
}
@@ -1030,7 +1030,7 @@ public class JPopupMenu extends JComponent implements Accessible,MenuElement {
Dimension newSize = getPreferredSize();
if (!oldSize.equals(newSize)) {
- popup = getPopup();
+ showPopup();
}
}
}