jdk/src/share/classes/javax/swing/RootPaneContainer.java
changeset 21255 0afb44cd0215
parent 5506 202f599c92aa
child 23010 6dadb192ad81
equal deleted inserted replaced
21254:f6d36ee3f269 21255:0afb44cd0215
    43  * that need to treat components like JFrame, that contain a
    43  * that need to treat components like JFrame, that contain a
    44  * single JRootPane, specially.  For example in a GUI builder,
    44  * single JRootPane, specially.  For example in a GUI builder,
    45  * dropping a component on a RootPaneContainer would be interpreted
    45  * dropping a component on a RootPaneContainer would be interpreted
    46  * as <code>frame.getContentPane().add(child)</code>.
    46  * as <code>frame.getContentPane().add(child)</code>.
    47  * <p>
    47  * <p>
    48  * For conveniance
    48  * As a convenience, the standard classes that implement this interface
    49  * <code>JFrame</code>, <code>JDialog</code>, <code>JWindow</code>,
    49  * (such as {@code JFrame}, {@code JDialog}, {@code JWindow}, {@code JApplet},
    50  * <code>JApplet</code> and <code>JInternalFrame</code>, by default,
    50  * and {@code JInternalFrame}) have their {@code add}, {@code remove},
    51  * forward, by default, all calls to the <code>add</code>,
    51  * and {@code setLayout} methods overridden, so that they delegate calls
    52  * <code>remove</code> and <code>setLayout</code> methods, to the
    52  * to the corresponding methods of the {@code ContentPane}.
    53  * <code>contentPane</code>. This means you can call:
    53  * For example, you can add a child component to a frame as follows:
    54  * <pre>
    54  * <pre>
    55  * rootPaneContainer.add(component);
    55  *       frame.add(child);
    56  * </pre>
    56  * </pre>
    57  * instead of:
    57  * instead of:
    58  * <pre>
    58  * <pre>
    59  * rootPaneContainer.getContentPane().add(component);
    59  *       frame.getContentPane().add(child);
    60  * </pre>
    60  * </pre>
    61  * <p>
    61  * <p>
    62  * The behavior of the <code>add</code> and
    62  * The behavior of the <code>add</code> and
    63  * <code>setLayout</code> methods for
    63  * <code>setLayout</code> methods for
    64  * <code>JFrame</code>, <code>JDialog</code>, <code>JWindow</code>,
    64  * <code>JFrame</code>, <code>JDialog</code>, <code>JWindow</code>,