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]

Patch: FYI: AWT fixes


I'm checking this in.

This is a couple minor AWT bug fixes.

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>

	* java/awt/List.java (processEvent): Added missing `else's.

	* java/awt/Window.java (show): validate() before showing.  Make
	parent displayable.
	(isDisplayable): New method.

Index: java/awt/List.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/awt/List.java,v
retrieving revision 1.7
diff -u -r1.7 List.java
--- java/awt/List.java 24 Mar 2002 22:37:51 -0000 1.7
+++ java/awt/List.java 9 Nov 2002 23:22:21 -0000
@@ -947,10 +947,10 @@
 {
   if (event instanceof ActionEvent)
     processActionEvent((ActionEvent)event);
-  if (event instanceof ItemEvent)
+  else if (event instanceof ItemEvent)
     processItemEvent((ItemEvent)event);
-
-  super.processEvent(event);
+  else
+    super.processEvent(event);
 }
 
 /*************************************************************************/
Index: java/awt/Window.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/awt/Window.java,v
retrieving revision 1.13
diff -u -r1.13 Window.java
--- java/awt/Window.java 9 Aug 2002 04:26:14 -0000 1.13
+++ java/awt/Window.java 9 Nov 2002 23:22:21 -0000
@@ -158,14 +158,13 @@
    */
   public void pack()
   {
-    if (parent != null
-        && !parent.isDisplayable())
+    if (parent != null && !parent.isDisplayable())
       parent.addNotify();
     if (peer == null)
       addNotify();
 
     setSize(getPreferredSize());
-    
+
     validate();
   }
 
@@ -174,9 +173,12 @@
    */
   public void show()
   {
+    if (parent != null && !parent.isDisplayable())
+      parent.addNotify();
     if (peer == null)
       addNotify();
 
+    validate();
     super.show();
     toFront();
   }
@@ -187,6 +189,13 @@
     super.hide();
   }
 
+  public boolean isDisplayable()
+  {
+    if (super.isDisplayable())
+      return true;
+    return peer != null;
+  }
+
   /**
    * Called to free any resource associated with this window.
    */
@@ -479,5 +488,4 @@
     if (peer != null) return peer.getGraphicsConfiguration();
     return null;
   }
-
 }


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