This patch has been committed.

On Fri, 2005-07-15 at 15:50 -0400, Anthony Balkissoon wrote:
> Once a JPopupMenu has been shown once, it no longer gets sized
> appropriately when components are added to or removed from it.  This
> patch fixes that, and seems to agree with the JDK although I could find
> no specific documentation supporting the decision to set the size to the
> JPopupMenu's preferred size.
> 
> 
> Patch attached.
> 
> 
> 2005-07-15  Anthony Balkissoon  <[EMAIL PROTECTED]>
> 
> * javax/swing/JPopupMenu.java:
> (insert): Resize the container to its preferred size when an item is
> inserted.
> (remove): Resize the container to its preferred size when an item is
>       removed.
> _______________________________________________
> Classpath-patches mailing list
> [email protected]
> http://lists.gnu.org/mailman/listinfo/classpath-patches
Index: javax/swing/JPopupMenu.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/JPopupMenu.java,v
retrieving revision 1.17
diff -u -r1.17 JPopupMenu.java
--- javax/swing/JPopupMenu.java	2 Jul 2005 20:32:48 -0000	1.17
+++ javax/swing/JPopupMenu.java	15 Jul 2005 19:38:42 -0000
@@ -232,6 +232,7 @@
 	constraints.gridy = i;
 	super.add(items[i], constraints, i);
       }
+    this.setSize(this.getPreferredSize());
   }
 
   /**
@@ -276,6 +277,7 @@
 	    super.add(items[i], constraints, i);
 	  }
       }
+    this.setSize(this.getPreferredSize());
   }
 
   /**
_______________________________________________
Classpath-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath-patches

Reply via email to