/[classpath]/classpath/javax/swing/JDialog.java
ViewVC logotype

Diff of /classpath/javax/swing/JDialog.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.9.2.4 by gnu_andrew, Sat Sep 10 15:31:48 2005 UTC revision 1.9.2.5 by gnu_andrew, Sun Nov 27 21:00:37 2005 UTC
# Line 102  public class JDialog extends Dialog impl Line 102  public class JDialog extends Dialog impl
102    /** Whether JDialogs are decorated by the Look and Feel. */    /** Whether JDialogs are decorated by the Look and Feel. */
103    private static boolean decorated;    private static boolean decorated;
104    
   /**  
    * Whether we're in the init stage or not.  
    * If so, adds and layouts are for top-level, otherwise they're for the  
    * content pane  
    */  
   private boolean initStageDone = false;  
   
105    /* Creates a new non-modal JDialog with no title    /* Creates a new non-modal JDialog with no title
106     * using a shared Frame as the owner.     * using a shared Frame as the owner.
107     */     */
# Line 259  public class JDialog extends Dialog impl Line 252  public class JDialog extends Dialog impl
252      invalidate();      invalidate();
253      // Now that initStageDone is true, adds and layouts apply to contentPane,      // Now that initStageDone is true, adds and layouts apply to contentPane,
254      // not top-level.      // not top-level.
255      initStageDone = true;      setRootPaneCheckingEnabled(true);
256    }    }
257    
258    /**    /**
# Line 330  public class JDialog extends Dialog impl Line 323  public class JDialog extends Dialog impl
323    {    {
324      // Check if we're in initialization stage. If so, call super.setLayout      // Check if we're in initialization stage. If so, call super.setLayout
325      // otherwise, valid calls go to the content pane.      // otherwise, valid calls go to the content pane.
326      if (initStageDone)      if (isRootPaneCheckingEnabled())
327        {        getContentPane().setLayout(manager);
         if (isRootPaneCheckingEnabled())  
           throw new Error("Cannot set top-level layout.  Use"  
                            + " getConentPane().setLayout instead.");  
           getContentPane().setLayout(manager);  
       }  
328      else      else
329        super.setLayout(manager);        super.setLayout(manager);
330    }    }
# Line 460  public class JDialog extends Dialog impl Line 448  public class JDialog extends Dialog impl
448    {    {
449      // If we're adding in the initialization stage use super.add.      // If we're adding in the initialization stage use super.add.
450      // Otherwise pass the add onto the content pane.      // Otherwise pass the add onto the content pane.
451      if (!initStageDone)      if (isRootPaneCheckingEnabled())
452        super.addImpl(comp, constraints, index);        getContentPane().add(comp, constraints, index);
453      else      else
454        {        super.addImpl(comp, constraints, index);
         if (isRootPaneCheckingEnabled())  
           throw new Error("Do not add directly to JDialog."  
                           + " Use getContentPane().add instead.");  
         getContentPane().add(comp, constraints, index);  
       }  
455    }    }
456    
457    /**    /**

Legend:
Removed from v.1.9.2.4  
changed lines
  Added in v.1.9.2.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26