jdk/src/java.desktop/share/classes/javax/swing/JPopupMenu.java
changeset 26037 508779ce6619
parent 26001 991e1be0b235
parent 25859 3317bb8137f4
child 32865 f9cb6e427f9e
--- 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;