--- old/src/share/classes/javax/swing/JPopupMenu.java 2013-11-20 18:18:38.568719500 +0400
+++ new/src/share/classes/javax/swing/JPopupMenu.java 2013-11-20 18:18:37.645666700 +0400
@@ -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 @@
if (pref == null || pref.width != getWidth() ||
pref.height != getHeight()) {
- popup = getPopup();
+ showPopup();
} else {
validate();
}
@@ -787,7 +787,7 @@
if(b) {
firePopupMenuWillBecomeVisible();
- popup = getPopup();
+ showPopup();
firePropertyChange("visible", Boolean.FALSE, Boolean.TRUE);
@@ -805,7 +805,7 @@
}
/**
- * Returns a Popup
instance from the
+ * Retrieves Popup
instance from the
* PopupMenuUI
that has had show
invoked on
* it. If the current popup
is non-null,
* this will invoke dispose
of it, and then
@@ -814,7 +814,7 @@
* 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 @@
desiredLocationY);
popupFactory.setPopupType(PopupFactory.LIGHT_WEIGHT_POPUP);
+ popup = newPopup;
newPopup.show();
- return newPopup;
}
/**
@@ -873,7 +873,7 @@
desiredLocationX = x;
desiredLocationY = y;
if(popup != null && (x != oldX || y != oldY)) {
- popup = getPopup();
+ showPopup();
}
}
@@ -1030,7 +1030,7 @@
Dimension newSize = getPreferredSize();
if (!oldSize.equals(newSize)) {
- popup = getPopup();
+ showPopup();
}
}
}