diff options
Diffstat (limited to 'java/awt/Container.java')
-rw-r--r-- | java/awt/Container.java | 36 |
1 files changed, 14 insertions, 22 deletions
diff --git a/java/awt/Container.java b/java/awt/Container.java index e6d8493d3..17ca3e0ad 100644 --- a/java/awt/Container.java +++ b/java/awt/Container.java @@ -87,8 +87,6 @@ public class Container extends Component Component[] component; LayoutManager layoutMgr; - Dimension maxSize; - /** * @since 1.4 */ @@ -653,45 +651,39 @@ public class Container extends Component return; ContainerPeer cPeer = null; - if (peer != null && ! (peer instanceof LightweightPeer)) + if (peer instanceof ContainerPeer) { cPeer = (ContainerPeer) peer; cPeer.beginValidate(); } - for (int i = 0; i < ncomponents; ++i) - { - Component comp = component[i]; - - if (comp.getPeer () == null) - comp.addNotify(); - } - doLayout (); for (int i = 0; i < ncomponents; ++i) { Component comp = component[i]; - if (! comp.isValid()) + if (comp instanceof Container && ! (comp instanceof Window) + && ! comp.valid) { - if (comp instanceof Container) - { - ((Container) comp).validateTree(); - } - else - { - component[i].validate(); - } + ((Container) comp).validateTree(); + } + else + { + comp.validate(); } } + if (peer instanceof ContainerPeer) + { + cPeer = (ContainerPeer) peer; + cPeer.endValidate(); + } + /* children will call invalidate() when they are layed out. It is therefore important that valid is not set to true until after the children have been layed out. */ valid = true; - if (cPeer != null) - cPeer.endValidate(); } public void setFont(Font f) |