classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] FYI: Another JInternalFrame fixlet


From: Roman Kennke
Subject: [cp-patches] FYI: Another JInternalFrame fixlet
Date: Mon, 11 Jul 2005 22:58:41 +0200
User-agent: Mozilla Thunderbird 1.0.2 (X11/20050331)

This addImpl method was behaving slighly wrong. It only added to the frame itself if the rootPane was added. Otherwise it added to the rootPane's contentPane. This is wrong, because there are other components that have to be added to the frame itself, most importantly the titleBar. This finally makes JInternalFrames look acceptable again.

2005-07-11  Roman Kennke  <address@hidden>

        * javax/swing/JInternalFrame.java
        (addImpl): Add to the frame itself if we are in the init
        stage, otherwise add to the contentPane.

/Roman
Index: javax/swing/JInternalFrame.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/JInternalFrame.java,v
retrieving revision 1.20
diff -u -r1.20 JInternalFrame.java
--- javax/swing/JInternalFrame.java     11 Jul 2005 11:57:23 -0000      1.20
+++ javax/swing/JInternalFrame.java     11 Jul 2005 20:53:34 -0000
@@ -584,9 +584,10 @@
    */
   protected void addImpl(Component comp, Object constraints, int index)
   {
-    // If we're adding the rootPane (initialization stages) use super.add.
-    // otherwise pass the add onto the content pane.
-    if (comp==rootPane)
+    // If we're in the initialization stage use super.add. Here we add the
+    // rootPane as well as the title bar and other stuff.
+    // Otherwise pass the add onto the content pane.
+    if (!initStageDone)
       super.addImpl(comp,constraints, index);
     else
       {

reply via email to

[Prev in Thread] Current Thread [Next in Thread]