Methods Summary |
---|
protected void | addImpl(java.awt.Component comp, java.lang.Object constraints, int index)Adds the specified child 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 {@link javax.swing.RootPaneContainer} for
details.
if(isRootPaneCheckingEnabled()) {
getContentPane().add(comp, constraints, index);
}
else {
super.addImpl(comp, constraints, index);
}
|
protected javax.swing.JRootPane | createRootPane()Called by the constructor methods to create the default rootPane.
JRootPane rp = new JRootPane();
// NOTE: this uses setOpaque vs LookAndFeel.installProperty as there
// is NO reason for the RootPane not to be opaque. For painting to
// work the contentPane must be opaque, therefor the RootPane can
// also be opaque.
rp.setOpaque(true);
return rp;
|
public javax.accessibility.AccessibleContext | getAccessibleContext()Gets the AccessibleContext associated with this JApplet.
For JApplets, the AccessibleContext takes the form of an
AccessibleJApplet.
A new AccessibleJApplet instance is created if necessary.
if (accessibleContext == null) {
accessibleContext = new AccessibleJApplet();
}
return accessibleContext;
|
public java.awt.Container | getContentPane()Returns the contentPane object for this applet.
return getRootPane().getContentPane();
|
public java.awt.Component | getGlassPane()Returns the glassPane object for this applet.
return getRootPane().getGlassPane();
|
public java.awt.Graphics | getGraphics(){@inheritDoc}
JComponent.getGraphicsInvoked(this);
return super.getGraphics();
|
public javax.swing.JMenuBar | getJMenuBar()Returns the menubar set on this applet.
return getRootPane().getMenuBar();
|
public javax.swing.JLayeredPane | getLayeredPane()Returns the layeredPane object for this applet.
return getRootPane().getLayeredPane();
|
public javax.swing.JRootPane | getRootPane()Returns the rootPane object for this applet.
return rootPane;
|
public javax.swing.TransferHandler | getTransferHandler()Gets the transferHandler property.
return transferHandler;
|
protected boolean | isRootPaneCheckingEnabled()Returns whether calls to add and
setLayout are forwarded to the contentPane .
return rootPaneCheckingEnabled;
|
protected java.lang.String | paramString()Returns a string representation of this JApplet. 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 null .
String rootPaneString = (rootPane != null ?
rootPane.toString() : "");
String rootPaneCheckingEnabledString = (rootPaneCheckingEnabled ?
"true" : "false");
return super.paramString() +
",rootPane=" + rootPaneString +
",rootPaneCheckingEnabled=" + rootPaneCheckingEnabledString;
|
public void | remove(java.awt.Component comp)Removes the specified component from the container. If
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 .
if (comp == rootPane) {
super.remove(comp);
} else {
getContentPane().remove(comp);
}
|
public void | repaint(long time, int x, int y, int width, int height)Repaints the specified rectangle of this component within
time milliseconds. Refer to RepaintManager
for details on how the repaint is handled.
if (RepaintManager.HANDLE_TOP_LEVEL_PAINT) {
RepaintManager.currentManager(this).addDirtyRegion(
this, x, y, width, height);
}
else {
super.repaint(time, x, y, width, height);
}
|
public void | setContentPane(java.awt.Container contentPane)Sets the contentPane property. This method is called by the constructor.
getRootPane().setContentPane(contentPane);
|
public void | setGlassPane(java.awt.Component glassPane)Sets the glassPane property.
This method is called by the constructor.
getRootPane().setGlassPane(glassPane);
|
public void | setJMenuBar(javax.swing.JMenuBar menuBar)Sets the menubar for this applet.
getRootPane().setMenuBar(menuBar);
|
public void | setLayeredPane(javax.swing.JLayeredPane layeredPane)Sets the layeredPane property. This method is called by the constructor.
getRootPane().setLayeredPane(layeredPane);
|
public void | setLayout(java.awt.LayoutManager manager)Sets the LayoutManager .
Overridden to conditionally forward the call to the
contentPane .
Refer to {@link javax.swing.RootPaneContainer} for
more information.
if(isRootPaneCheckingEnabled()) {
getContentPane().setLayout(manager);
}
else {
super.setLayout(manager);
}
|
protected void | setRootPane(javax.swing.JRootPane root)Sets the rootPane property. This method is called by the constructor.
if(rootPane != null) {
remove(rootPane);
}
rootPane = root;
if(rootPane != null) {
boolean checkingEnabled = isRootPaneCheckingEnabled();
try {
setRootPaneCheckingEnabled(false);
add(rootPane, BorderLayout.CENTER);
}
finally {
setRootPaneCheckingEnabled(checkingEnabled);
}
}
|
protected void | setRootPaneCheckingEnabled(boolean enabled)Sets whether calls to add and
setLayout are forwarded to the contentPane .
rootPaneCheckingEnabled = enabled;
|
public void | setTransferHandler(javax.swing.TransferHandler newHandler)Sets the {@code transferHandler} property, which is a mechanism to
support transfer of data into this component. Use {@code null}
if the component does not support data transfer operations.
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.
TransferHandler oldHandler = transferHandler;
transferHandler = newHandler;
SwingUtilities.installSwingDropTargetAsNecessary(this, transferHandler);
firePropertyChange("transferHandler", oldHandler, newHandler);
|
public void | update(java.awt.Graphics g)Just calls paint(g) . This method was overridden to
prevent an unnecessary call to clear the background.
paint(g);
|