This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[gui][PATCH] fix Applet size reporting


Hi,

This patch fixes a problem with how applets report their size.  If the
applet stub is not set, then Applet should use Panel's implementation of
preferredSize and minimumSize.  I committed this to java-gui-branch.

Tom

2004-04-29  Thomas Fitzsimmons  <fitzsim@redhat.com>

	* java/applet/Applet.java (preferredSize): Call parent's
	preferredSize if the applet stub is null.
	(minimumSize): Likewise for parent's minimumSize.


Index: java/applet/Applet.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/applet/Applet.java,v
retrieving revision 1.3.36.3
diff -u -r1.3.36.3 Applet.java
--- java/applet/Applet.java	16 Mar 2004 04:43:35 -0000	1.3.36.3
+++ java/applet/Applet.java	28 Apr 2004 16:35:36 -0000
@@ -483,7 +483,7 @@
    */
   public Dimension preferredSize()
   {
-    return getDimensions ();
+    return stub == null ? super.preferredSize () : getDimensions ();
   }
 
   /**
@@ -494,7 +494,7 @@
    */
   public Dimension minimumSize()
   {
-    return getDimensions ();
+    return stub == null ? super.minimumSize () : getDimensions ();
   }
 
   /**



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]