jdk/src/share/classes/javax/swing/JPanel.java
author dmarkov
Wed, 16 Apr 2014 12:51:25 +0400
changeset 24184 4da2f6ec4dab
parent 22574 7f8ce0c8c20a
child 25201 4adc75e0c4e5
permissions -rw-r--r--
8032874: ArrayIndexOutOfBoundsException in JTable while clearing data in JTable Reviewed-by: alexp, alexsch
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
22574
7f8ce0c8c20a 8032627: Add @SuppressWarnings("serial") to appropriate javax.swing classes
darcy
parents: 20458
diff changeset
     2
 * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
package javax.swing;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
import java.awt.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import javax.swing.plaf.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
import javax.accessibility.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
import java.io.Serializable;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
import java.io.ObjectOutputStream;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
import java.io.ObjectInputStream;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
import java.io.IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 * <code>JPanel</code> is a generic lightweight container.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 * For examples and task-oriented documentation for JPanel, see
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 * <a
20455
f6f9a0c2796b 8020688: Broken links in documentation at http://docs.oracle.com/javase/6/docs/api/index.
mcherkas
parents: 20157
diff changeset
    42
 href="http://docs.oracle.com/javase/tutorial/uiswing/components/panel.html">How to Use Panels</a>,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 * a section in <em>The Java Tutorial</em>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 * <strong>Warning:</strong> Swing is not thread safe. For more
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
 * information see <a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
 * href="package-summary.html#threading">Swing's Threading
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
 * Policy</a>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
 * <strong>Warning:</strong>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
 * Serialized objects of this class will not be compatible with
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
 * future Swing releases. The current serialization support is
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
 * appropriate for short term storage or RMI between applications running
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
 * the same version of Swing.  As of 1.4, support for long term storage
20458
f2423fb3fd19 8025840: Fix all the doclint warnings about trademark
cl
parents: 20455
diff changeset
    55
 * of all JavaBeans&trade;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
 * has been added to the <code>java.beans</code> package.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
 * Please see {@link java.beans.XMLEncoder}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
 * @beaninfo
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
 * description: A generic lightweight container.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
 * @author Arnaud Weber
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
 * @author Steve Wilson
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
 */
22574
7f8ce0c8c20a 8032627: Add @SuppressWarnings("serial") to appropriate javax.swing classes
darcy
parents: 20458
diff changeset
    65
@SuppressWarnings("serial") // Same-version serialization only
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
public class JPanel extends JComponent implements Accessible
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
     * @see #getUIClassID
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
     * @see #readObject
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
    private static final String uiClassID = "PanelUI";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
     * Creates a new JPanel with the specified layout manager and buffering
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
     * strategy.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
     * @param layout  the LayoutManager to use
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
     * @param isDoubleBuffered  a boolean, true for double-buffering, which
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
     *        uses additional memory space to achieve fast, flicker-free
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
     *        updates
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
    public JPanel(LayoutManager layout, boolean isDoubleBuffered) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
        setLayout(layout);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
        setDoubleBuffered(isDoubleBuffered);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
        setUIProperty("opaque", Boolean.TRUE);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
        updateUI();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
     * Create a new buffered JPanel with the specified layout manager
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
     * @param layout  the LayoutManager to use
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
    public JPanel(LayoutManager layout) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
        this(layout, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
     * Creates a new <code>JPanel</code> with <code>FlowLayout</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
     * and the specified buffering strategy.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
     * If <code>isDoubleBuffered</code> is true, the <code>JPanel</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
     * will use a double buffer.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
     * @param isDoubleBuffered  a boolean, true for double-buffering, which
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
     *        uses additional memory space to achieve fast, flicker-free
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
     *        updates
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
    public JPanel(boolean isDoubleBuffered) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
        this(new FlowLayout(), isDoubleBuffered);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
     * Creates a new <code>JPanel</code> with a double buffer
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
     * and a flow layout.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
    public JPanel() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
        this(true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
     * Resets the UI property with a value from the current look and feel.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
     * @see JComponent#updateUI
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
    public void updateUI() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
        setUI((PanelUI)UIManager.getUI(this));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
    /**
20157
cafca01a8e28 8025230: [cleanup] some more javadoc formatting fixes for swing
yan
parents: 5506
diff changeset
   131
     * Returns the look and feel (L&amp;amp;F) object that renders this component.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
     * @return the PanelUI object that renders this component
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
    public PanelUI getUI() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
        return (PanelUI)ui;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
    /**
20157
cafca01a8e28 8025230: [cleanup] some more javadoc formatting fixes for swing
yan
parents: 5506
diff changeset
   142
     * Sets the look and feel (L&amp;F) object that renders this component.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
     *
20157
cafca01a8e28 8025230: [cleanup] some more javadoc formatting fixes for swing
yan
parents: 5506
diff changeset
   144
     * @param ui  the PanelUI L&amp;F object
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
     * @see UIDefaults#getUI
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
     * @beaninfo
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
     *        bound: true
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
     *       hidden: true
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
     *    attribute: visualUpdate true
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
     *  description: The UI object that implements the Component's LookAndFeel.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
    public void setUI(PanelUI ui) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
        super.setUI(ui);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
    /**
20157
cafca01a8e28 8025230: [cleanup] some more javadoc formatting fixes for swing
yan
parents: 5506
diff changeset
   158
     * Returns a string that specifies the name of the L&amp;F class
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
     * that renders this component.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
     * @return "PanelUI"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
     * @see JComponent#getUIClassID
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
     * @see UIDefaults#getUI
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
     * @beaninfo
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
     *        expert: true
20157
cafca01a8e28 8025230: [cleanup] some more javadoc formatting fixes for swing
yan
parents: 5506
diff changeset
   166
     *   description: A string that specifies the name of the L&amp;F class.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
    public String getUIClassID() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
        return uiClassID;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
     * See readObject() and writeObject() in JComponent for more
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
     * information about serialization in Swing.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
    private void writeObject(ObjectOutputStream s) throws IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
        s.defaultWriteObject();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
        if (getUIClassID().equals(uiClassID)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
            byte count = JComponent.getWriteObjCounter(this);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
            JComponent.setWriteObjCounter(this, --count);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
            if (count == 0 && ui != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
                ui.installUI(this);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
     * Returns a string representation of this JPanel. This method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
     * is intended to be used only for debugging purposes, and the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
     * content and format of the returned string may vary between
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
     * implementations. The returned string may be empty but may not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
     * be <code>null</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
     * @return  a string representation of this JPanel.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
    protected String paramString() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
        return super.paramString();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
/////////////////
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
// Accessibility support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
////////////////
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
     * Gets the AccessibleContext associated with this JPanel.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
     * For JPanels, the AccessibleContext takes the form of an
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
     * AccessibleJPanel.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
     * A new AccessibleJPanel instance is created if necessary.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
     * @return an AccessibleJPanel that serves as the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
     *         AccessibleContext of this JPanel
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
    public AccessibleContext getAccessibleContext() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
        if (accessibleContext == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
            accessibleContext = new AccessibleJPanel();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
        return accessibleContext;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
     * This class implements accessibility support for the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
     * <code>JPanel</code> class.  It provides an implementation of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
     * Java Accessibility API appropriate to panel user-interface
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
     * elements.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
     * <strong>Warning:</strong>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
     * Serialized objects of this class will not be compatible with
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
     * future Swing releases. The current serialization support is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
     * appropriate for short term storage or RMI between applications running
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
     * the same version of Swing.  As of 1.4, support for long term storage
20458
f2423fb3fd19 8025840: Fix all the doclint warnings about trademark
cl
parents: 20455
diff changeset
   233
     * of all JavaBeans&trade;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
     * has been added to the <code>java.beans</code> package.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
     * Please see {@link java.beans.XMLEncoder}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
     */
22574
7f8ce0c8c20a 8032627: Add @SuppressWarnings("serial") to appropriate javax.swing classes
darcy
parents: 20458
diff changeset
   237
    @SuppressWarnings("serial") // Same-version serialization only
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
    protected class AccessibleJPanel extends AccessibleJComponent {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
         * Get the role of this object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
         *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
         * @return an instance of AccessibleRole describing the role of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
         * object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
        public AccessibleRole getAccessibleRole() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
            return AccessibleRole.PANEL;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
}