diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 319e3fbf48e..956a317a7fb 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,12 @@ +2003-04-20 Scott Gilbertson + + * java/awt/Container.java (addImpl): Enable paint events if adding + a lightweight to a heavyweight. + (addNotify): Ensure that peer is created before + addNotifyContainerChildren. + (addNotifyContainerChildren): Enable paint events if a heavyweight + container contains a lightweight. + 2003-04-20 Tom Tromey * java/io/BufferedReader.java, java/io/BufferedWriter.java, diff --git a/libjava/java/awt/Container.java b/libjava/java/awt/Container.java index 9ef6add71db..9bad369e53f 100644 --- a/libjava/java/awt/Container.java +++ b/libjava/java/awt/Container.java @@ -297,9 +297,13 @@ public class Container extends Component if (peer != null) { comp.addNotify(); - - if (comp.isLightweight()) - enableEvents(comp.eventMask); + + if (comp.isLightweight ()) + { + enableEvents (comp.eventMask); + if (!isLightweight ()) + enableEvents (AWTEvent.PAINT_EVENT_MASK); + } } invalidate(); @@ -907,8 +911,8 @@ public class Container extends Component */ public void addNotify() { - addNotifyContainerChildren(); super.addNotify(); + addNotifyContainerChildren(); } /** @@ -1288,8 +1292,12 @@ public class Container extends Component for (int i = ncomponents; --i >= 0; ) { component[i].addNotify(); - if (component[i].isLightweight()) - enableEvents(component[i].eventMask); + if (component[i].isLightweight ()) + { + enableEvents(component[i].eventMask); + if (peer != null && !isLightweight ()) + enableEvents (AWTEvent.PAINT_EVENT_MASK); + } } } }