--- a/jdk/src/java.desktop/share/classes/javax/swing/JPopupMenu.java Mon Aug 18 14:03:21 2014 +0100
+++ b/jdk/src/java.desktop/share/classes/javax/swing/JPopupMenu.java Tue Aug 19 10:32:16 2014 -0700
@@ -1345,7 +1345,20 @@
// implements javax.swing.MenuElement
private void readObject(ObjectInputStream s)
throws IOException, ClassNotFoundException {
- s.defaultReadObject();
+ ObjectInputStream.GetField f = s.readFields();
+
+ int newDesiredLocationX = f.get("desiredLocationX", 0);
+ int newDesiredLocationY = f.get("desiredLocationY", 0);
+ Point p = adjustPopupLocationToFitScreen(
+ newDesiredLocationX, newDesiredLocationY);
+ desiredLocationX = p.x;
+ desiredLocationY = p.y;
+
+ label = (String) f.get("label", null);
+ paintBorder = f.get("paintBorder", false);
+ margin = (Insets) f.get("margin", null);
+ lightWeightPopup = f.get("lightWeightPopup", false);
+ selectionModel = (SingleSelectionModel) f.get("selectionModel", null);
Vector<?> values = (Vector)s.readObject();
int indexCounter = 0;