java.lang.ObjectPanel
java.applet.Applet
javax.swing.JApplet
All Implemented Interfaces:
HasGetTransferHandler, Accessible, RootPaneContainer
Direct Known Subclasses:
BankApplet, HTMLEdit, jTansApplet
java.applet.Applet that adds support for
the JFC/Swing component architecture.
You can find task-oriented documentation about using JApplet
in The Java Tutorial,
in the section
How to Make Applets.
The JApplet class is slightly incompatible with
java.applet.Applet. JApplet contains a
JRootPane as its only child. The contentPane
should be the parent of any children of the JApplet.
As a convenience add and its variants, remove and
setLayout have been overridden to forward to the
contentPane as necessary. This means you can write:
applet.add(child);And the child will be added to the
contentPane.
The contentPane will always be non-null.
Attempting to set it to null will cause the
JApplet to throw an exception. The default
contentPane will have a BorderLayout
manager set on it.
Refer to javax.swing.RootPaneContainer
for details on adding, removing and setting the LayoutManager
of a JApplet.
Please see the JRootPane documentation for a
complete description of the contentPane, glassPane,
and layeredPane properties.
Warning: Swing is not thread safe. For more information see Swing's Threading Policy.
Warning:
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 JavaBeansTM
has been added to the java.beans package.
Please see java.beans.XMLEncoder .
attribute - : isContainer true
attribute: containerDelegate getContentPane
description: Swing's Applet subclass.Arnaud - Weber| Nested Class Summary: | ||
|---|---|---|
| protected class | JApplet.AccessibleJApplet | This class implements accessibility support for the
JApplet class. |
| Field Summary | ||
|---|---|---|
| protected JRootPane | rootPane |
|
| protected boolean | rootPaneCheckingEnabled | If true then calls to add and setLayout
will be forwarded to the contentPane. This is initially
false, but is set to true when the JApplet is constructed. |
| protected AccessibleContext | accessibleContext | |
| Fields inherited from java.applet.Applet: |
|---|
| accessibleContext |
| Constructor: |
|---|
This constructor sets the component's locale property to the value
returned by
|
| Method from javax.swing.JApplet Summary: |
|---|
| addImpl, createRootPane, getAccessibleContext, getContentPane, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isRootPaneCheckingEnabled, paramString, remove, repaint, setContentPane, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update |
| Methods from java.applet.Applet: |
|---|
| destroy, getAccessibleContext, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, init, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus, start, stop |
| Methods from java.lang.Object: |
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method from javax.swing.JApplet Detail: |
|---|
Component.
This method is overridden to conditionally forward calls to the
contentPane.
By default, children are added to the contentPane instead
of the frame, refer to javax.swing.RootPaneContainer for
details. |
|
|
|
|
|
|
|
|
transferHandler property. |
add and
setLayout are forwarded to the contentPane. |
null. |
comp is not the rootPane, this will forward
the call to the contentPane. This will do nothing if
comp is not a child of the JFrame or
contentPane. |
time milliseconds. Refer to RepaintManager
for details on how the repaint is handled. |
|
|
|
|
LayoutManager.
Overridden to conditionally forward the call to the
contentPane.
Refer to javax.swing.RootPaneContainer for
more information. |
|
add and
setLayout are forwarded to the contentPane. |
If the system property {@code suppressSwingDropSupport} is {@code false} (the default) and the current drop target on this component is either {@code null} or not a user-set drop target, this method will change the drop target as follows: If {@code newHandler} is {@code null} it will clear the drop target. If not {@code null} it will install a new {@code DropTarget}. Note: When used with {@code JApplet}, {@code TransferHandler} only provides data import capability, as the data export related methods are currently typed to {@code JComponent}. Please see How to Use Drag and Drop and Data Transfer, a section in The Java Tutorial, for more information. |
paint(g). This method was overridden to
prevent an unnecessary call to clear the background. |