< prev index next >

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

Print this page
rev 55815 : 8225372: accessibility errors in tables in java.desktop files
Reviewed-by: aivanov
   1 /*
   2  * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  54  * alt="The following text describes this graphic."
  55  * HEIGHT=484 WIDTH=629></p>
  56  * The &quot;heavyweight&quot; components (those that delegate to a peer, or native
  57  * component on the host system) are shown with a darker, heavier box. The four
  58  * heavyweight JFC/Swing containers (<code>JFrame</code>, <code>JDialog</code>,
  59  * <code>JWindow</code>, and <code>JApplet</code>) are
  60  * shown in relation to the AWT classes they extend.
  61  * These four components are the
  62  * only heavyweight containers in the Swing library. The lightweight container
  63  * <code>JInternalFrame</code> is also shown.
  64  * All five of these JFC/Swing containers implement the
  65  * <code>RootPaneContainer</code> interface,
  66  * and they all delegate their operations to a
  67  * <code>JRootPane</code> (shown with a little "handle" on top).
  68  * <blockquote>
  69  * <b>Note:</b> The <code>JComponent</code> method <code>getRootPane</code>
  70  * can be used to obtain the <code>JRootPane</code> that contains
  71  * a given component.
  72  * </blockquote>
  73  *
  74  * <table class="borderless" style="float:right">
  75  * <caption>Example</caption>
  76  * <tr>
  77  * <td style="text-align:center">
  78  * <img src="doc-files/JRootPane-2.gif"
  79  * alt="The following text describes this graphic." HEIGHT=386 WIDTH=349>
  80  * </td>
  81  * </tr>
  82  * </table>
  83  * The diagram at right shows the structure of a <code>JRootPane</code>.
  84  * A <code>JRootpane</code> is made up of a <code>glassPane</code>,
  85  * an optional <code>menuBar</code>, and a <code>contentPane</code>.
  86  * (The <code>JLayeredPane</code> manages the <code>menuBar</code>
  87  * and the <code>contentPane</code>.)
  88  * The <code>glassPane</code> sits over the top of everything,
  89  * where it is in a position to intercept mouse movements.
  90  * Since the <code>glassPane</code> (like the <code>contentPane</code>)
  91  * can be an arbitrary component, it is also possible to set up the
  92  * <code>glassPane</code> for drawing. Lines and images on the
  93  * <code>glassPane</code> can then range
  94  * over the frames underneath without being limited by their boundaries.
  95  * <p>
  96  * Although the <code>menuBar</code> component is optional,
  97  * the <code>layeredPane</code>, <code>contentPane</code>,
  98  * and <code>glassPane</code> always exist.
  99  * Attempting to set them to <code>null</code> generates an exception.
 100  * <p>
 101  * To add components to the <code>JRootPane</code> (other than the
 102  * optional menu bar), you add the object to the <code>contentPane</code>


   1 /*
   2  * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  54  * alt="The following text describes this graphic."
  55  * HEIGHT=484 WIDTH=629></p>
  56  * The &quot;heavyweight&quot; components (those that delegate to a peer, or native
  57  * component on the host system) are shown with a darker, heavier box. The four
  58  * heavyweight JFC/Swing containers (<code>JFrame</code>, <code>JDialog</code>,
  59  * <code>JWindow</code>, and <code>JApplet</code>) are
  60  * shown in relation to the AWT classes they extend.
  61  * These four components are the
  62  * only heavyweight containers in the Swing library. The lightweight container
  63  * <code>JInternalFrame</code> is also shown.
  64  * All five of these JFC/Swing containers implement the
  65  * <code>RootPaneContainer</code> interface,
  66  * and they all delegate their operations to a
  67  * <code>JRootPane</code> (shown with a little "handle" on top).
  68  * <blockquote>
  69  * <b>Note:</b> The <code>JComponent</code> method <code>getRootPane</code>
  70  * can be used to obtain the <code>JRootPane</code> that contains
  71  * a given component.
  72  * </blockquote>
  73  *
  74  * <div style="float:right;text-align:center;font-weight:bold">
  75  *   <p>Example:
  76  *   <p><img src="doc-files/JRootPane-2.gif"
  77  *      alt="the following text describes this graphic." height=386 width=349>
  78  * </div>




  79  * The diagram at right shows the structure of a <code>JRootPane</code>.
  80  * A <code>JRootpane</code> is made up of a <code>glassPane</code>,
  81  * an optional <code>menuBar</code>, and a <code>contentPane</code>.
  82  * (The <code>JLayeredPane</code> manages the <code>menuBar</code>
  83  * and the <code>contentPane</code>.)
  84  * The <code>glassPane</code> sits over the top of everything,
  85  * where it is in a position to intercept mouse movements.
  86  * Since the <code>glassPane</code> (like the <code>contentPane</code>)
  87  * can be an arbitrary component, it is also possible to set up the
  88  * <code>glassPane</code> for drawing. Lines and images on the
  89  * <code>glassPane</code> can then range
  90  * over the frames underneath without being limited by their boundaries.
  91  * <p>
  92  * Although the <code>menuBar</code> component is optional,
  93  * the <code>layeredPane</code>, <code>contentPane</code>,
  94  * and <code>glassPane</code> always exist.
  95  * Attempting to set them to <code>null</code> generates an exception.
  96  * <p>
  97  * To add components to the <code>JRootPane</code> (other than the
  98  * optional menu bar), you add the object to the <code>contentPane</code>


< prev index next >