< prev index next >

src/java.desktop/share/classes/javax/swing/JWindow.java

Print this page

        

@@ -32,40 +32,40 @@
 import java.io.Serializable;
 
 import javax.accessibility.*;
 
 /**
- * A <code>JWindow</code> is a container that can be displayed anywhere on the
+ * A {@code JWindow} is a container that can be displayed anywhere on the
  * user's desktop. It does not have the title bar, window-management buttons,
- * or other trimmings associated with a <code>JFrame</code>, but it is still a
+ * or other trimmings associated with a {@code JFrame}, but it is still a
  * "first-class citizen" of the user's desktop, and can exist anywhere
  * on it.
  * <p>
- * The <code>JWindow</code> component contains a <code>JRootPane</code>
- * as its only child.  The <code>contentPane</code> should be the parent
- * of any children of the <code>JWindow</code>.
+ * The {@code JWindow} component contains a {@code JRootPane}
+ * as its only child.  The {@code contentPane} should be the parent
+ * of any children of the {@code JWindow}.
  * As a convenience, the {@code add}, {@code remove}, and {@code setLayout}
  * methods of this class are overridden, so that they delegate calls
  * to the corresponding methods of the {@code ContentPane}.
  * For example, you can add a child component to a window as follows:
  * <pre>
  *       window.add(child);
  * </pre>
  * And the child will be added to the contentPane.
- * The <code>contentPane</code> will always be non-<code>null</code>.
- * Attempting to set it to <code>null</code> will cause the <code>JWindow</code>
- * to throw an exception. The default <code>contentPane</code> will have a
- * <code>BorderLayout</code> manager set on it.
+ * The {@code contentPane} will always be non-{@code null}.
+ * Attempting to set it to {@code null} will cause the {@code JWindow}
+ * to throw an exception. The default {@code contentPane} will have a
+ * {@code BorderLayout} manager set on it.
  * Refer to {@link javax.swing.RootPaneContainer}
- * for details on adding, removing and setting the <code>LayoutManager</code>
- * of a <code>JWindow</code>.
+ * for details on adding, removing and setting the {@code LayoutManager}
+ * of a {@code JWindow}.
  * <p>
  * Please see the {@link JRootPane} documentation for a complete description of
- * the <code>contentPane</code>, <code>glassPane</code>, and
- * <code>layeredPane</code> components.
+ * the {@code contentPane}, {@code glassPane}, and
+ * {@code layeredPane} components.
  * <p>
- * In a multi-screen environment, you can create a <code>JWindow</code>
+ * In a multi-screen environment, you can create a {@code JWindow}
  * on a different screen device.  See {@link java.awt.Window} for more
  * information.
  * <p>
  * <strong>Warning:</strong> Swing is not thread safe. For more
  * information see <a

@@ -76,11 +76,11 @@
  * Serialized objects of this class will not be compatible with
  * future Swing releases. The current serialization support is
  * appropriate for short term storage or RMI between applications running
  * the same version of Swing.  As of 1.4, support for long term storage
  * of all JavaBeans&trade;
- * has been added to the <code>java.beans</code> package.
+ * has been added to the {@code java.beans} package.
  * Please see {@link java.beans.XMLEncoder}.
  *
  * @see JRootPane
  *
  * @beaninfo

@@ -95,67 +95,67 @@
 public class JWindow extends Window implements Accessible,
                                                RootPaneContainer,
                                TransferHandler.HasGetTransferHandler
 {
     /**
-     * The <code>JRootPane</code> instance that manages the
-     * <code>contentPane</code>
-     * and optional <code>menuBar</code> for this frame, as well as the
-     * <code>glassPane</code>.
+     * The {@code JRootPane} instance that manages the
+     * {@code contentPane}
+     * and optional {@code menuBar} for this frame, as well as the
+     * {@code glassPane}.
      *
      * @see #getRootPane
      * @see #setRootPane
      */
     protected JRootPane rootPane;
 
     /**
-     * If true then calls to <code>add</code> and <code>setLayout</code>
-     * will be forwarded to the <code>contentPane</code>. This is initially
-     * false, but is set to true when the <code>JWindow</code> is constructed.
+     * If true then calls to {@code add} and {@code setLayout}
+     * will be forwarded to the {@code contentPane}. This is initially
+     * false, but is set to true when the {@code JWindow} is constructed.
      *
      * @see #isRootPaneCheckingEnabled
      * @see #setRootPaneCheckingEnabled
      * @see javax.swing.RootPaneContainer
      */
     protected boolean rootPaneCheckingEnabled = false;
 
     /**
-     * The <code>TransferHandler</code> for this window.
+     * The {@code TransferHandler} for this window.
      */
     private TransferHandler transferHandler;
 
     /**
      * Creates a window with no specified owner. This window will not be
      * focusable.
      * <p>
      * This constructor sets the component's locale property to the value
-     * returned by <code>JComponent.getDefaultLocale</code>.
+     * returned by {@code JComponent.getDefaultLocale}.
      *
      * @throws HeadlessException if
-     *         <code>GraphicsEnvironment.isHeadless()</code> returns true.
+     *         {@code GraphicsEnvironment.isHeadless()} returns true.
      * @see java.awt.GraphicsEnvironment#isHeadless
      * @see #isFocusableWindow
      * @see JComponent#getDefaultLocale
      */
     public JWindow() {
         this((Frame)null);
     }
 
     /**
-     * Creates a window with the specified <code>GraphicsConfiguration</code>
+     * Creates a window with the specified {@code GraphicsConfiguration}
      * of a screen device. This window will not be focusable.
      * <p>
      * This constructor sets the component's locale property to the value
-     * returned by <code>JComponent.getDefaultLocale</code>.
+     * returned by {@code JComponent.getDefaultLocale}.
      *
-     * @param gc the <code>GraphicsConfiguration</code> that is used
-     *          to construct the new window with; if gc is <code>null</code>,
-     *          the system default <code>GraphicsConfiguration</code>
+     * @param gc the {@code GraphicsConfiguration} that is used
+     *          to construct the new window with; if gc is {@code null},
+     *          the system default {@code GraphicsConfiguration}
      *          is assumed
      * @throws HeadlessException If
-     *         <code>GraphicsEnvironment.isHeadless()</code> returns true.
-     * @throws IllegalArgumentException if <code>gc</code> is not from
+     *         {@code GraphicsEnvironment.isHeadless()} returns true.
+     * @throws IllegalArgumentException if {@code gc} is not from
      *         a screen device.
      *
      * @see java.awt.GraphicsEnvironment#isHeadless
      * @see #isFocusableWindow
      * @see JComponent#getDefaultLocale

@@ -167,17 +167,17 @@
         super.setFocusableWindowState(false);
     }
 
     /**
      * Creates a window with the specified owner frame.
-     * If <code>owner</code> is <code>null</code>, the shared owner
+     * If {@code owner} is {@code null}, the shared owner
      * will be used and this window will not be focusable. Also,
      * this window will not be focusable unless its owner is showing
      * on the screen.
      * <p>
      * This constructor sets the component's locale property to the value
-     * returned by <code>JComponent.getDefaultLocale</code>.
+     * returned by {@code JComponent.getDefaultLocale}.
      *
      * @param owner the frame from which the window is displayed
      * @throws HeadlessException if GraphicsEnvironment.isHeadless()
      *            returns true.
      * @see java.awt.GraphicsEnvironment#isHeadless

@@ -195,19 +195,19 @@
     }
 
     /**
      * Creates a window with the specified owner window. This window
      * will not be focusable unless its owner is showing on the screen.
-     * If <code>owner</code> is <code>null</code>, the shared owner
+     * If {@code owner} is {@code null}, the shared owner
      * will be used and this window will not be focusable.
      * <p>
      * This constructor sets the component's locale property to the value
-     * returned by <code>JComponent.getDefaultLocale</code>.
+     * returned by {@code JComponent.getDefaultLocale}.
      *
      * @param owner the window from which the window is displayed
      * @throws HeadlessException if
-     *         <code>GraphicsEnvironment.isHeadless()</code> returns true.
+     *         {@code GraphicsEnvironment.isHeadless()} returns true.
      * @see java.awt.GraphicsEnvironment#isHeadless
      * @see #isFocusableWindow
      * @see JComponent#getDefaultLocale
      */
     public JWindow(Window owner) {

@@ -221,27 +221,27 @@
         windowInit();
     }
 
     /**
      * Creates a window with the specified owner window and
-     * <code>GraphicsConfiguration</code> of a screen device. If
-     * <code>owner</code> is <code>null</code>, the shared owner will be used
+     * {@code GraphicsConfiguration} of a screen device. If
+     * {@code owner} is {@code null}, the shared owner will be used
      * and this window will not be focusable.
      * <p>
      * This constructor sets the component's locale property to the value
-     * returned by <code>JComponent.getDefaultLocale</code>.
+     * returned by {@code JComponent.getDefaultLocale}.
      *
      * @param owner the window from which the window is displayed
-     * @param gc the <code>GraphicsConfiguration</code> that is used
-     *          to construct the new window with; if gc is <code>null</code>,
-     *          the system default <code>GraphicsConfiguration</code>
-     *          is assumed, unless <code>owner</code> is also null, in which
-     *          case the <code>GraphicsConfiguration</code> from the
+     * @param gc the {@code GraphicsConfiguration} that is used
+     *          to construct the new window with; if gc is {@code null},
+     *          the system default {@code GraphicsConfiguration}
+     *          is assumed, unless {@code owner} is also null, in which
+     *          case the {@code GraphicsConfiguration} from the
      *          shared owner frame will be used.
      * @throws HeadlessException if
-     *         <code>GraphicsEnvironment.isHeadless()</code> returns true.
-     * @throws IllegalArgumentException if <code>gc</code> is not from
+     *         {@code GraphicsEnvironment.isHeadless()} returns true.
+     * @throws IllegalArgumentException if {@code gc} is not from
      *         a screen device.
      *
      * @see java.awt.GraphicsEnvironment#isHeadless
      * @see #isFocusableWindow
      * @see JComponent#getDefaultLocale

@@ -258,22 +258,22 @@
         }
         windowInit();
     }
 
     /**
-     * Called by the constructors to init the <code>JWindow</code> properly.
+     * Called by the constructors to init the {@code JWindow} properly.
      */
     protected void windowInit() {
         setLocale( JComponent.getDefaultLocale() );
         setRootPane(createRootPane());
         setRootPaneCheckingEnabled(true);
         sun.awt.SunToolkit.checkAndSetPolicy(this);
     }
 
     /**
      * Called by the constructor methods to create the default
-     * <code>rootPane</code>.
+     * {@code rootPane}.
      *
      * @return a new {@code JRootPane}
      */
     protected JRootPane createRootPane() {
         JRootPane rp = new JRootPane();

@@ -284,14 +284,14 @@
         rp.setOpaque(true);
         return rp;
     }
 
     /**
-     * Returns whether calls to <code>add</code> and
-     * <code>setLayout</code> are forwarded to the <code>contentPane</code>.
+     * Returns whether calls to {@code add} and
+     * {@code setLayout} are forwarded to the {@code contentPane}.
      *
-     * @return true if <code>add</code> and <code>setLayout</code>
+     * @return true if {@code add} and {@code setLayout}
      *         are forwarded; false otherwise
      *
      * @see #addImpl
      * @see #setLayout
      * @see #setRootPaneCheckingEnabled

@@ -340,39 +340,39 @@
         SwingUtilities.installSwingDropTargetAsNecessary(this, transferHandler);
         firePropertyChange("transferHandler", oldHandler, newHandler);
     }
 
     /**
-     * Gets the <code>transferHandler</code> property.
+     * Gets the {@code transferHandler} property.
      *
-     * @return the value of the <code>transferHandler</code> property
+     * @return the value of the {@code transferHandler} property
      *
      * @see TransferHandler
      * @see #setTransferHandler
      * @since 1.6
      */
     public TransferHandler getTransferHandler() {
         return transferHandler;
     }
 
     /**
-     * Calls <code>paint(g)</code>.  This method was overridden to
+     * Calls {@code paint(g)}.  This method was overridden to
      * prevent an unnecessary call to clear the background.
      *
-     * @param g  the <code>Graphics</code> context in which to paint
+     * @param g  the {@code Graphics} context in which to paint
      */
     public void update(Graphics g) {
         paint(g);
     }
 
     /**
-     * Sets whether calls to <code>add</code> and
-     * <code>setLayout</code> are forwarded to the <code>contentPane</code>.
+     * Sets whether calls to {@code add} and
+     * {@code setLayout} are forwarded to the {@code contentPane}.
      *
-     * @param enabled  true if <code>add</code> and <code>setLayout</code>
+     * @param enabled  true if {@code add} and {@code setLayout}
      *        are forwarded, false if they should operate directly on the
-     *        <code>JWindow</code>.
+     *        {@code JWindow}.
      *
      * @see #addImpl
      * @see #setLayout
      * @see #isRootPaneCheckingEnabled
      * @see javax.swing.RootPaneContainer

@@ -384,21 +384,21 @@
         rootPaneCheckingEnabled = enabled;
     }
 
 
     /**
-     * Adds the specified child <code>Component</code>.
+     * Adds the specified child {@code Component}.
      * This method is overridden to conditionally forward calls to the
-     * <code>contentPane</code>.
-     * By default, children are added to the <code>contentPane</code> instead
+     * {@code contentPane}.
+     * By default, children are added to the {@code contentPane} instead
      * of the frame, refer to {@link javax.swing.RootPaneContainer} for
      * details.
      *
      * @param comp the component to be enhanced
      * @param constraints the constraints to be respected
      * @param index the index
-     * @exception IllegalArgumentException if <code>index</code> is invalid
+     * @exception IllegalArgumentException if {@code index} is invalid
      * @exception IllegalArgumentException if adding the container's parent
      *                  to itself
      * @exception IllegalArgumentException if adding a window to a container
      *
      * @see #setRootPaneCheckingEnabled

@@ -414,17 +414,17 @@
         }
     }
 
     /**
      * Removes the specified component from the container. If
-     * <code>comp</code> is not the <code>rootPane</code>, this will forward
-     * the call to the <code>contentPane</code>. This will do nothing if
-     * <code>comp</code> is not a child of the <code>JWindow</code> or
-     * <code>contentPane</code>.
+     * {@code comp} is not the {@code rootPane}, this will forward
+     * the call to the {@code contentPane}. This will do nothing if
+     * {@code comp} is not a child of the {@code JWindow} or
+     * {@code contentPane}.
      *
      * @param comp the component to be removed
-     * @throws NullPointerException if <code>comp</code> is null
+     * @throws NullPointerException if {@code comp} is null
      * @see #add
      * @see javax.swing.RootPaneContainer
      */
     public void remove(Component comp) {
         if (comp == rootPane) {

@@ -434,17 +434,17 @@
         }
     }
 
 
     /**
-     * Sets the <code>LayoutManager</code>.
+     * Sets the {@code LayoutManager}.
      * Overridden to conditionally forward the call to the
-     * <code>contentPane</code>.
+     * {@code contentPane}.
      * Refer to {@link javax.swing.RootPaneContainer} for
      * more information.
      *
-     * @param manager the <code>LayoutManager</code>
+     * @param manager the {@code LayoutManager}
      * @see #setRootPaneCheckingEnabled
      * @see javax.swing.RootPaneContainer
      */
     public void setLayout(LayoutManager manager) {
         if(isRootPaneCheckingEnabled()) {

@@ -455,26 +455,26 @@
         }
     }
 
 
     /**
-     * Returns the <code>rootPane</code> object for this window.
-     * @return the <code>rootPane</code> property for this window
+     * Returns the {@code rootPane} object for this window.
+     * @return the {@code rootPane} property for this window
      *
      * @see #setRootPane
      * @see RootPaneContainer#getRootPane
      */
     public JRootPane getRootPane() {
         return rootPane;
     }
 
 
     /**
-     * Sets the new <code>rootPane</code> object for this window.
+     * Sets the new {@code rootPane} object for this window.
      * This method is called by the constructor.
      *
-     * @param root the new <code>rootPane</code> property
+     * @param root the new {@code rootPane} property
      * @see #getRootPane
      *
      * @beaninfo
      *        hidden: true
      *   description: the RootPane object for this window.

@@ -496,29 +496,29 @@
         }
     }
 
 
     /**
-     * Returns the <code>Container</code> which is the <code>contentPane</code>
+     * Returns the {@code Container} which is the {@code contentPane}
      * for this window.
      *
-     * @return the <code>contentPane</code> property
+     * @return the {@code contentPane} property
      * @see #setContentPane
      * @see RootPaneContainer#getContentPane
      */
     public Container getContentPane() {
         return getRootPane().getContentPane();
     }
 
     /**
-     * Sets the <code>contentPane</code> property for this window.
+     * Sets the {@code contentPane} property for this window.
      * This method is called by the constructor.
      *
-     * @param contentPane the new <code>contentPane</code>
+     * @param contentPane the new {@code contentPane}
      *
      * @exception IllegalComponentStateException (a runtime
-     *            exception) if the content pane parameter is <code>null</code>
+     *            exception) if the content pane parameter is {@code null}
      * @see #getContentPane
      * @see RootPaneContainer#setContentPane
      *
      * @beaninfo
      *     hidden: true

@@ -528,28 +528,28 @@
     public void setContentPane(Container contentPane) {
         getRootPane().setContentPane(contentPane);
     }
 
     /**
-     * Returns the <code>layeredPane</code> object for this window.
+     * Returns the {@code layeredPane} object for this window.
      *
-     * @return the <code>layeredPane</code> property
+     * @return the {@code layeredPane} property
      * @see #setLayeredPane
      * @see RootPaneContainer#getLayeredPane
      */
     public JLayeredPane getLayeredPane() {
         return getRootPane().getLayeredPane();
     }
 
     /**
-     * Sets the <code>layeredPane</code> property.
+     * Sets the {@code layeredPane} property.
      * This method is called by the constructor.
      *
-     * @param layeredPane the new <code>layeredPane</code> object
+     * @param layeredPane the new {@code layeredPane} object
      *
      * @exception IllegalComponentStateException (a runtime
-     *            exception) if the content pane parameter is <code>null</code>
+     *            exception) if the content pane parameter is {@code null}
      * @see #getLayeredPane
      * @see RootPaneContainer#setLayeredPane
      *
      * @beaninfo
      *     hidden: true

@@ -558,24 +558,24 @@
     public void setLayeredPane(JLayeredPane layeredPane) {
         getRootPane().setLayeredPane(layeredPane);
     }
 
     /**
-     * Returns the <code>glassPane Component</code> for this window.
+     * Returns the {@code glassPane Component} for this window.
      *
-     * @return the <code>glassPane</code> property
+     * @return the {@code glassPane} property
      * @see #setGlassPane
      * @see RootPaneContainer#getGlassPane
      */
     public Component getGlassPane() {
         return getRootPane().getGlassPane();
     }
 
     /**
-     * Sets the <code>glassPane</code> property.
+     * Sets the {@code glassPane} property.
      * This method is called by the constructor.
-     * @param glassPane the <code>glassPane</code> object for this window
+     * @param glassPane the {@code glassPane} object for this window
      *
      * @see #getGlassPane
      * @see RootPaneContainer#setGlassPane
      *
      * @beaninfo

@@ -596,11 +596,11 @@
         return super.getGraphics();
     }
 
     /**
      * Repaints the specified rectangle of this component within
-     * <code>time</code> milliseconds.  Refer to <code>RepaintManager</code>
+     * {@code time} milliseconds.  Refer to {@code RepaintManager}
      * for details on how the repaint is handled.
      *
      * @param     time   maximum time in milliseconds before update
      * @param     x    the <i>x</i> coordinate
      * @param     y    the <i>y</i> coordinate

@@ -618,18 +618,18 @@
             super.repaint(time, x, y, width, height);
         }
     }
 
     /**
-     * Returns a string representation of this <code>JWindow</code>.
+     * Returns a string representation of this {@code JWindow}.
      * This method
      * is intended to be used only for debugging purposes, and the
      * content and format of the returned string may vary between
      * implementations. The returned string may be empty but may not
-     * be <code>null</code>.
+     * be {@code null}.
      *
-     * @return  a string representation of this <code>JWindow</code>
+     * @return  a string representation of this {@code JWindow}
      */
     protected String paramString() {
         String rootPaneCheckingEnabledString = (rootPaneCheckingEnabled ?
                                                 "true" : "false");
 

@@ -662,11 +662,11 @@
     }
 
 
     /**
      * This class implements accessibility support for the
-     * <code>JWindow</code> class.  It provides an implementation of the
+     * {@code JWindow} class.  It provides an implementation of the
      * Java Accessibility API appropriate to window user-interface
      * elements.
      */
     @SuppressWarnings("serial")
     protected class AccessibleJWindow extends AccessibleAWTWindow {
< prev index next >