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

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

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

revision 1.8.2.7 by gnu_andrew, Wed Nov 2 00:43:44 2005 UTC revision 1.8.2.8 by gnu_andrew, Sun Nov 27 21:00:37 2005 UTC
# Line 85  public class JApplet extends Applet Line 85  public class JApplet extends Applet
85    /**    /**
86     * @specnote rootPaneCheckingEnabled is false to comply with J2SE 5.0     * @specnote rootPaneCheckingEnabled is false to comply with J2SE 5.0
87     */     */
88    protected boolean rootPaneCheckingEnabled=false;    protected boolean rootPaneCheckingEnabled = false;
   
   /**  
    * Tells us if we're in the initialization stage.  
    * If so, adds go to top-level Container, otherwise they go  
    * to the content pane for this container  
    */  
   private boolean initStageDone = false;  
89    
90    public JApplet()    public JApplet()
91    {    {
92      super.setLayout(new BorderLayout(1, 1));      super.setLayout(new BorderLayout(1, 1));
93      getRootPane(); // Will do set/create.      getRootPane(); // Will do set/create.
94      initStageDone = true; // Init stage is now over.      setRootPaneCheckingEnabled(true); // Init stage is now over.
95    }    }
96    
97    public Dimension getPreferredSize()    public Dimension getPreferredSize()
# Line 110  public class JApplet extends Applet Line 103  public class JApplet extends Applet
103    {    {
104      // Check if we're in initialization stage.  If so, call super.setLayout      // Check if we're in initialization stage.  If so, call super.setLayout
105      // otherwise, valid calls go to the content pane      // otherwise, valid calls go to the content pane
106      if (initStageDone)      if (isRootPaneCheckingEnabled())
107        {        getContentPane().setLayout(manager);
         if (isRootPaneCheckingEnabled())  
           throw new Error("Cannot set layout. Use getContentPane().setLayout()"  
                            + "instead.");  
         getContentPane().setLayout(manager);  
       }  
108      else      else
109        super.setLayout(manager);        super.setLayout(manager);
110    }    }
# Line 176  public class JApplet extends Applet Line 164  public class JApplet extends Applet
164    {    {
165      // If we're adding in the initialization stage use super.add.      // If we're adding in the initialization stage use super.add.
166      // Otherwise pass the add onto the content pane.      // Otherwise pass the add onto the content pane.
167      if (!initStageDone)      if (isRootPaneCheckingEnabled())
168        super.addImpl(comp, constraints, index);        getContentPane().add(comp, constraints, index);
169      else      else
170        {        super.addImpl(comp, constraints, index);
         if (isRootPaneCheckingEnabled())  
           throw new Error("Do not use add() on JApplet directly. Use "  
                            + "getContentPane().add() instead");  
         getContentPane().add(comp, constraints, index);  
       }  
171    }    }
172    
173    public AccessibleContext getAccessibleContext()    public AccessibleContext getAccessibleContext()
# Line 206  public class JApplet extends Applet Line 189  public class JApplet extends Applet
189    
190    protected String paramString()    protected String paramString()
191    {    {
192      return "JFrame";      return super.paramString();
193    }    }
194    
195    protected void processKeyEvent(KeyEvent e)    protected void processKeyEvent(KeyEvent e)

Legend:
Removed from v.1.8.2.7  
changed lines
  Added in v.1.8.2.8

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