JInternalFrame (Java SE 15 & JDK 15) (original) (raw)
All Implemented Interfaces:
[ImageObserver](../../java/awt/image/ImageObserver.html "interface in java.awt.image")
, [MenuContainer](../../java/awt/MenuContainer.html "interface in java.awt")
, [Serializable](../../../java.base/java/io/Serializable.html "interface in java.io")
, [Accessible](../accessibility/Accessible.html "interface in javax.accessibility")
, [RootPaneContainer](RootPaneContainer.html "interface in javax.swing")
, [WindowConstants](WindowConstants.html "interface in javax.swing")
@JavaBean(defaultProperty="JMenuBar", description="A frame container which is contained within another window.") public class JInternalFrame extends JComponent implements Accessible, WindowConstants, RootPaneContainer
A lightweight object that provides many of the features of a native frame, including dragging, closing, becoming an icon, resizing, title display, and support for a menu bar. For task-oriented documentation and examples of using internal frames, see How to Use Internal Frames, a section in The Java Tutorial.
Generally, you add JInternalFrame
s to a JDesktopPane
. The UI delegates the look-and-feel-specific actions to theDesktopManager
object maintained by the JDesktopPane
.
The JInternalFrame
content pane is where you add child components. As a convenience, the add
, remove
, and setLayout
methods of this class are overridden, so that they delegate calls to the corresponding methods of the ContentPane
. For example, you can add a child component to an internal frame as follows:
internalFrame.add(child);
And the child will be added to the contentPane. The content pane is actually managed by an instance ofJRootPane
, which also manages a layout pane, glass pane, and optional menu bar for the internal frame. Please see theJRootPane
documentation for a complete description of these components. Refer to RootPaneContainer for details on adding, removing and setting the LayoutManager
of a JInternalFrame
.
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 JavaBeans has been added to the java.beans
package. Please see XMLEncoder.
Since:
1.2
See Also:
InternalFrameEvent, JDesktopPane, DesktopManager, JInternalFrame.JDesktopIcon, JRootPane, RootPaneContainer
Nested Class Summary
Field Summary
Fields
Modifier and Type | Field | Description |
---|---|---|
protected boolean | closable | The frame can be closed. |
static String | CONTENT_PANE_PROPERTY | Bound property name. |
protected JInternalFrame.JDesktopIcon | desktopIcon | The icon that is displayed when this internal frame is iconified. |
static String | FRAME_ICON_PROPERTY | Bound property name. |
protected Icon | frameIcon | The icon shown in the top-left corner of this internal frame. |
static String | GLASS_PANE_PROPERTY | Bound property name. |
protected boolean | iconable | The frame can "iconified" (shrunk down and displayed as an icon-image). |
static String | IS_CLOSED_PROPERTY | Constrained property name indicating that the internal frame is closed. |
static String | IS_ICON_PROPERTY | Constrained property name indicating that the internal frame is iconified. |
static String | IS_MAXIMUM_PROPERTY | Constrained property name indicating that the internal frame is maximized. |
static String | IS_SELECTED_PROPERTY | Constrained property name indicated that this frame has selected status. |
protected boolean | isClosed | The frame has been closed. |
protected boolean | isIcon | The frame has been iconified. |
protected boolean | isMaximum | The frame has been expanded to its maximum size. |
protected boolean | isSelected | The frame is currently selected. |
static String | LAYERED_PANE_PROPERTY | Bound property name. |
protected boolean | maximizable | The frame can be expanded to the size of the desktop pane. |
static String | MENU_BAR_PROPERTY | Bound property name. |
protected boolean | resizable | The frame's size can be changed. |
static String | ROOT_PANE_PROPERTY | Bound property name. |
protected JRootPane | rootPane | The JRootPane instance that manages the content pane and optional menu bar for this internal frame, as well as the glass pane. |
protected boolean | rootPaneCheckingEnabled | If true then calls to add and setLayout will be forwarded to the contentPane. |
protected String | title | The title displayed in this internal frame's title bar. |
static String | TITLE_PROPERTY | Bound property name. |
Constructor Summary
Constructors
Constructor | Description |
---|---|
JInternalFrame() | Creates a non-resizable, non-closable, non-maximizable, non-iconifiable JInternalFrame with no title. |
JInternalFrame(String title) | Creates a non-resizable, non-closable, non-maximizable, non-iconifiable JInternalFrame with the specified title. |
JInternalFrame(String title, boolean resizable) | Creates a non-closable, non-maximizable, non-iconifiableJInternalFrame with the specified title and resizability. |
JInternalFrame(String title, boolean resizable, boolean closable) | Creates a non-maximizable, non-iconifiable JInternalFrame with the specified title, resizability, and closability. |
JInternalFrame(String title, boolean resizable, boolean closable, boolean maximizable) | Creates a non-iconifiable JInternalFrame with the specified title, resizability, closability, and maximizability. |
JInternalFrame(String title, boolean resizable, boolean closable, boolean maximizable, boolean iconifiable) | Creates a JInternalFrame with the specified title, resizability, closability, maximizability, and iconifiability. |
Method Summary
Modifier and Type | Method | Description |
---|---|---|
protected void | addImpl(Component comp,Object constraints, int index) | Adds the specified child Component. |
void | addInternalFrameListener(InternalFrameListener l) | Adds the specified listener to receive internal frame events from this internal frame. |
protected JRootPane | createRootPane() | Called by the constructor to set up the JRootPane. |
void | dispose() | Makes this internal frame invisible, unselected, and closed. |
void | doDefaultCloseAction() | Fires anINTERNAL_FRAME_CLOSING event and then performs the action specified by the internal frame's default close operation. |
protected void | fireInternalFrameEvent(int id) | Fires an internal frame event. |
AccessibleContext | getAccessibleContext() | Gets the AccessibleContext associated with thisJInternalFrame. |
Container | getContentPane() | Returns the content pane for this internal frame. |
int | getDefaultCloseOperation() | Returns the default operation that occurs when the user initiates a "close" on this internal frame. |
JInternalFrame.JDesktopIcon | getDesktopIcon() | Returns the JDesktopIcon used when thisJInternalFrame is iconified. |
JDesktopPane | getDesktopPane() | Convenience method that searches the ancestor hierarchy for aJDesktop instance. |
Container | getFocusCycleRootAncestor() | Always returns null because JInternalFrames must always be roots of a focus traversal cycle. |
Component | getFocusOwner() | If this JInternalFrame is active, returns the child that has focus. |
Icon | getFrameIcon() | Returns the image displayed in the title bar of this internal frame (usually in the top-left corner). |
Component | getGlassPane() | Returns the glass pane for this internal frame. |
InternalFrameListener[] | getInternalFrameListeners() | Returns an array of all the InternalFrameListeners added to this JInternalFrame withaddInternalFrameListener. |
JMenuBar | getJMenuBar() | Returns the current JMenuBar for thisJInternalFrame, or null if no menu bar has been set. |
Cursor | getLastCursor() | Returns the last Cursor that was set by thesetCursor method that is not a resizableCursor. |
int | getLayer() | Convenience method for getting the layer attribute of this component. |
JLayeredPane | getLayeredPane() | Returns the layered pane for this internal frame. |
JMenuBar | getMenuBar() | Deprecated. |
Component | getMostRecentFocusOwner() | Returns the child component of this JInternalFrame that will receive the focus when this JInternalFrame is selected. |
Rectangle | getNormalBounds() | If the JInternalFrame is not in maximized state, returnsgetBounds(); otherwise, returns the bounds that theJInternalFrame would be restored to. |
JRootPane | getRootPane() | Returns the rootPane object for this internal frame. |
String | getTitle() | Returns the title of the JInternalFrame. |
InternalFrameUI | getUI() | Returns the look-and-feel object that renders this component. |
String | getUIClassID() | Returns the name of the look-and-feel class that renders this component. |
String | getWarningString() | Gets the warning string that is displayed with this internal frame. |
boolean | isClosable() | Returns whether this JInternalFrame can be closed by some user action. |
boolean | isClosed() | Returns whether this JInternalFrame is currently closed. |
boolean | isFocusCycleRoot() | Always returns true because all JInternalFrames must be roots of a focus traversal cycle. |
boolean | isIcon() | Returns whether the JInternalFrame is currently iconified. |
boolean | isIconifiable() | Gets the iconable property, which by default is false. |
boolean | isMaximizable() | Gets the value of the maximizable property. |
boolean | isMaximum() | Returns whether the JInternalFrame is currently maximized. |
boolean | isResizable() | Returns whether the JInternalFrame can be resized by some user action. |
protected boolean | isRootPaneCheckingEnabled() | Returns whether calls to add andsetLayout are forwarded to the contentPane. |
boolean | isSelected() | Returns whether the JInternalFrame is the currently "selected" or active frame. |
void | moveToBack() | Convenience method that moves this component to position -1 if its parent is a JLayeredPane. |
void | moveToFront() | Convenience method that moves this component to position 0 if its parent is a JLayeredPane. |
void | pack() | Causes subcomponents of this JInternalFrame to be laid out at their preferred size. |
protected void | paintComponent(Graphics g) | Overridden to allow optimized painting when the internal frame is being dragged. |
protected String | paramString() | Returns a string representation of this JInternalFrame. |
void | remove(Component comp) | Removes the specified component from the container. |
void | removeInternalFrameListener(InternalFrameListener l) | Removes the specified internal frame listener so that it no longer receives internal frame events from this internal frame. |
void | reshape(int x, int y, int width, int height) | Moves and resizes this component. |
void | restoreSubcomponentFocus() | Requests the internal frame to restore focus to the last subcomponent that had focus. |
void | setClosable(boolean b) | Sets whether this JInternalFrame can be closed by some user action. |
void | setClosed(boolean b) | Closes this internal frame if the argument is true. |
void | setContentPane(Container c) | Sets this JInternalFrame's contentPane property. |
void | setCursor(Cursor cursor) | Sets the cursor image to the specified cursor. |
void | setDefaultCloseOperation(int operation) | Sets the operation that will happen by default when the user initiates a "close" on this internal frame. |
void | setDesktopIcon(JInternalFrame.JDesktopIcon d) | Sets the JDesktopIcon associated with thisJInternalFrame. |
void | setFocusCycleRoot(boolean focusCycleRoot) | Does nothing because JInternalFrames must always be roots of a focus traversal cycle. |
void | setFrameIcon(Icon icon) | Sets an image to be displayed in the titlebar of this internal frame (usually in the top-left corner). |
void | setGlassPane(Component glass) | Sets this JInternalFrame'sglassPane property. |
void | setIcon(boolean b) | Iconifies or de-iconifies this internal frame, if the look and feel supports iconification. |
void | setIconifiable(boolean b) | Sets the iconable property, which must be true for the user to be able to make the JInternalFrame an icon. |
void | setJMenuBar(JMenuBar m) | Sets the menuBar property for this JInternalFrame. |
void | setLayer(int layer) | Convenience method for setting the layer attribute of this component. |
void | setLayer(Integer layer) | Convenience method for setting the layer attribute of this component. |
void | setLayeredPane(JLayeredPane layered) | Sets this JInternalFrame'slayeredPane property. |
void | setLayout(LayoutManager manager) | Ensures that, by default, the layout of this component cannot be set. |
void | setMaximizable(boolean b) | Sets the maximizable property, which determines whether the JInternalFrame can be maximized by some user action. |
void | setMaximum(boolean b) | Maximizes and restores this internal frame. |
void | setMenuBar(JMenuBar m) | Deprecated. |
void | setNormalBounds(Rectangle r) | Sets the normal bounds for this internal frame, the bounds that this internal frame would be restored to from its maximized state. |
void | setResizable(boolean b) | Sets whether the JInternalFrame can be resized by some user action. |
protected void | setRootPane(JRootPane root) | Sets the rootPane property for this JInternalFrame. |
protected void | setRootPaneCheckingEnabled(boolean enabled) | Sets whether calls to add andsetLayout are forwarded to the contentPane. |
void | setSelected(boolean selected) | Selects or deselects the internal frame if it's showing. |
void | setTitle(String title) | Sets the JInternalFrame title. |
void | setUI(InternalFrameUI ui) | Sets the UI delegate for this JInternalFrame. |
void | show() | If the internal frame is not visible, brings the internal frame to the front, makes it visible, and attempts to select it. |
void | toBack() | Sends this internal frame to the back. |
void | toFront() | Brings this internal frame to the front. |
void | updateUI() | Notification from the UIManager that the look and feel has changed. |
Methods declared in class javax.swing.JComponent
[addAncestorListener](JComponent.html#addAncestorListener%28javax.swing.event.AncestorListener%29), [addNotify](JComponent.html#addNotify%28%29), [addVetoableChangeListener](JComponent.html#addVetoableChangeListener%28java.beans.VetoableChangeListener%29), [computeVisibleRect](JComponent.html#computeVisibleRect%28java.awt.Rectangle%29), [contains](JComponent.html#contains%28int,int%29), [createToolTip](JComponent.html#createToolTip%28%29), [disable](JComponent.html#disable%28%29), [enable](JComponent.html#enable%28%29), [firePropertyChange](JComponent.html#firePropertyChange%28java.lang.String,boolean,boolean%29), [firePropertyChange](JComponent.html#firePropertyChange%28java.lang.String,int,int%29), [fireVetoableChange](JComponent.html#fireVetoableChange%28java.lang.String,java.lang.Object,java.lang.Object%29), [getActionForKeyStroke](JComponent.html#getActionForKeyStroke%28javax.swing.KeyStroke%29), [getActionMap](JComponent.html#getActionMap%28%29), [getAlignmentX](JComponent.html#getAlignmentX%28%29), [getAlignmentY](JComponent.html#getAlignmentY%28%29), [getAncestorListeners](JComponent.html#getAncestorListeners%28%29), [getAutoscrolls](JComponent.html#getAutoscrolls%28%29), [getBaseline](JComponent.html#getBaseline%28int,int%29), [getBaselineResizeBehavior](JComponent.html#getBaselineResizeBehavior%28%29), [getBorder](JComponent.html#getBorder%28%29), [getBounds](JComponent.html#getBounds%28java.awt.Rectangle%29), [getClientProperty](JComponent.html#getClientProperty%28java.lang.Object%29), [getComponentGraphics](JComponent.html#getComponentGraphics%28java.awt.Graphics%29), [getComponentPopupMenu](JComponent.html#getComponentPopupMenu%28%29), [getConditionForKeyStroke](JComponent.html#getConditionForKeyStroke%28javax.swing.KeyStroke%29), [getDebugGraphicsOptions](JComponent.html#getDebugGraphicsOptions%28%29), [getDefaultLocale](JComponent.html#getDefaultLocale%28%29), [getFontMetrics](JComponent.html#getFontMetrics%28java.awt.Font%29), [getGraphics](JComponent.html#getGraphics%28%29), [getHeight](JComponent.html#getHeight%28%29), [getInheritsPopupMenu](JComponent.html#getInheritsPopupMenu%28%29), [getInputMap](JComponent.html#getInputMap%28%29), [getInputMap](JComponent.html#getInputMap%28int%29), [getInputVerifier](JComponent.html#getInputVerifier%28%29), [getInsets](JComponent.html#getInsets%28%29), [getInsets](JComponent.html#getInsets%28java.awt.Insets%29), [getListeners](JComponent.html#getListeners%28java.lang.Class%29), [getLocation](JComponent.html#getLocation%28java.awt.Point%29), [getMaximumSize](JComponent.html#getMaximumSize%28%29), [getMinimumSize](JComponent.html#getMinimumSize%28%29), [getNextFocusableComponent](JComponent.html#getNextFocusableComponent%28%29), [getPopupLocation](JComponent.html#getPopupLocation%28java.awt.event.MouseEvent%29), [getPreferredSize](JComponent.html#getPreferredSize%28%29), [getRegisteredKeyStrokes](JComponent.html#getRegisteredKeyStrokes%28%29), [getSize](JComponent.html#getSize%28java.awt.Dimension%29), [getToolTipLocation](JComponent.html#getToolTipLocation%28java.awt.event.MouseEvent%29), [getToolTipText](JComponent.html#getToolTipText%28%29), [getToolTipText](JComponent.html#getToolTipText%28java.awt.event.MouseEvent%29), [getTopLevelAncestor](JComponent.html#getTopLevelAncestor%28%29), [getTransferHandler](JComponent.html#getTransferHandler%28%29), [getVerifyInputWhenFocusTarget](JComponent.html#getVerifyInputWhenFocusTarget%28%29), [getVetoableChangeListeners](JComponent.html#getVetoableChangeListeners%28%29), [getVisibleRect](JComponent.html#getVisibleRect%28%29), [getWidth](JComponent.html#getWidth%28%29), [getX](JComponent.html#getX%28%29), [getY](JComponent.html#getY%28%29), [grabFocus](JComponent.html#grabFocus%28%29), [hide](JComponent.html#hide%28%29), [isDoubleBuffered](JComponent.html#isDoubleBuffered%28%29), [isLightweightComponent](JComponent.html#isLightweightComponent%28java.awt.Component%29), [isManagingFocus](JComponent.html#isManagingFocus%28%29), [isOpaque](JComponent.html#isOpaque%28%29), [isOptimizedDrawingEnabled](JComponent.html#isOptimizedDrawingEnabled%28%29), [isPaintingForPrint](JComponent.html#isPaintingForPrint%28%29), [isPaintingOrigin](JComponent.html#isPaintingOrigin%28%29), [isPaintingTile](JComponent.html#isPaintingTile%28%29), [isRequestFocusEnabled](JComponent.html#isRequestFocusEnabled%28%29), [isValidateRoot](JComponent.html#isValidateRoot%28%29), [paint](JComponent.html#paint%28java.awt.Graphics%29), [paintBorder](JComponent.html#paintBorder%28java.awt.Graphics%29), [paintChildren](JComponent.html#paintChildren%28java.awt.Graphics%29), [paintImmediately](JComponent.html#paintImmediately%28int,int,int,int%29), [paintImmediately](JComponent.html#paintImmediately%28java.awt.Rectangle%29), [print](JComponent.html#print%28java.awt.Graphics%29), [printAll](JComponent.html#printAll%28java.awt.Graphics%29), [printBorder](JComponent.html#printBorder%28java.awt.Graphics%29), [printChildren](JComponent.html#printChildren%28java.awt.Graphics%29), [printComponent](JComponent.html#printComponent%28java.awt.Graphics%29), [processComponentKeyEvent](JComponent.html#processComponentKeyEvent%28java.awt.event.KeyEvent%29), [processKeyBinding](JComponent.html#processKeyBinding%28javax.swing.KeyStroke,java.awt.event.KeyEvent,int,boolean%29), [processKeyEvent](JComponent.html#processKeyEvent%28java.awt.event.KeyEvent%29), [processMouseEvent](JComponent.html#processMouseEvent%28java.awt.event.MouseEvent%29), [processMouseMotionEvent](JComponent.html#processMouseMotionEvent%28java.awt.event.MouseEvent%29), [putClientProperty](JComponent.html#putClientProperty%28java.lang.Object,java.lang.Object%29), [registerKeyboardAction](JComponent.html#registerKeyboardAction%28java.awt.event.ActionListener,java.lang.String,javax.swing.KeyStroke,int%29), [registerKeyboardAction](JComponent.html#registerKeyboardAction%28java.awt.event.ActionListener,javax.swing.KeyStroke,int%29), [removeAncestorListener](JComponent.html#removeAncestorListener%28javax.swing.event.AncestorListener%29), [removeNotify](JComponent.html#removeNotify%28%29), [removeVetoableChangeListener](JComponent.html#removeVetoableChangeListener%28java.beans.VetoableChangeListener%29), [repaint](JComponent.html#repaint%28long,int,int,int,int%29), [repaint](JComponent.html#repaint%28java.awt.Rectangle%29), [requestDefaultFocus](JComponent.html#requestDefaultFocus%28%29), [requestFocus](JComponent.html#requestFocus%28%29), [requestFocus](JComponent.html#requestFocus%28boolean%29), [requestFocusInWindow](JComponent.html#requestFocusInWindow%28%29), [requestFocusInWindow](JComponent.html#requestFocusInWindow%28boolean%29), [resetKeyboardActions](JComponent.html#resetKeyboardActions%28%29), [revalidate](JComponent.html#revalidate%28%29), [scrollRectToVisible](JComponent.html#scrollRectToVisible%28java.awt.Rectangle%29), [setActionMap](JComponent.html#setActionMap%28javax.swing.ActionMap%29), [setAlignmentX](JComponent.html#setAlignmentX%28float%29), [setAlignmentY](JComponent.html#setAlignmentY%28float%29), [setAutoscrolls](JComponent.html#setAutoscrolls%28boolean%29), [setBackground](JComponent.html#setBackground%28java.awt.Color%29), [setBorder](JComponent.html#setBorder%28javax.swing.border.Border%29), [setComponentPopupMenu](JComponent.html#setComponentPopupMenu%28javax.swing.JPopupMenu%29), [setDebugGraphicsOptions](JComponent.html#setDebugGraphicsOptions%28int%29), [setDefaultLocale](JComponent.html#setDefaultLocale%28java.util.Locale%29), [setDoubleBuffered](JComponent.html#setDoubleBuffered%28boolean%29), [setEnabled](JComponent.html#setEnabled%28boolean%29), [setFocusTraversalKeys](JComponent.html#setFocusTraversalKeys%28int,java.util.Set%29), [setFont](JComponent.html#setFont%28java.awt.Font%29), [setForeground](JComponent.html#setForeground%28java.awt.Color%29), [setInheritsPopupMenu](JComponent.html#setInheritsPopupMenu%28boolean%29), [setInputMap](JComponent.html#setInputMap%28int,javax.swing.InputMap%29), [setInputVerifier](JComponent.html#setInputVerifier%28javax.swing.InputVerifier%29), [setMaximumSize](JComponent.html#setMaximumSize%28java.awt.Dimension%29), [setMinimumSize](JComponent.html#setMinimumSize%28java.awt.Dimension%29), [setNextFocusableComponent](JComponent.html#setNextFocusableComponent%28java.awt.Component%29), [setOpaque](JComponent.html#setOpaque%28boolean%29), [setPreferredSize](JComponent.html#setPreferredSize%28java.awt.Dimension%29), [setRequestFocusEnabled](JComponent.html#setRequestFocusEnabled%28boolean%29), [setToolTipText](JComponent.html#setToolTipText%28java.lang.String%29), [setTransferHandler](JComponent.html#setTransferHandler%28javax.swing.TransferHandler%29), [setUI](JComponent.html#setUI%28javax.swing.plaf.ComponentUI%29), [setVerifyInputWhenFocusTarget](JComponent.html#setVerifyInputWhenFocusTarget%28boolean%29), [setVisible](JComponent.html#setVisible%28boolean%29), [unregisterKeyboardAction](JComponent.html#unregisterKeyboardAction%28javax.swing.KeyStroke%29), [update](JComponent.html#update%28java.awt.Graphics%29)
Methods declared in class java.awt.Container
[add](../../java/awt/Container.html#add%28java.awt.Component%29), [add](../../java/awt/Container.html#add%28java.awt.Component,int%29), [add](../../java/awt/Container.html#add%28java.awt.Component,java.lang.Object%29), [add](../../java/awt/Container.html#add%28java.awt.Component,java.lang.Object,int%29), [add](../../java/awt/Container.html#add%28java.lang.String,java.awt.Component%29), [addContainerListener](../../java/awt/Container.html#addContainerListener%28java.awt.event.ContainerListener%29), [addPropertyChangeListener](../../java/awt/Container.html#addPropertyChangeListener%28java.beans.PropertyChangeListener%29), [addPropertyChangeListener](../../java/awt/Container.html#addPropertyChangeListener%28java.lang.String,java.beans.PropertyChangeListener%29), [applyComponentOrientation](../../java/awt/Container.html#applyComponentOrientation%28java.awt.ComponentOrientation%29), [areFocusTraversalKeysSet](../../java/awt/Container.html#areFocusTraversalKeysSet%28int%29), [countComponents](../../java/awt/Container.html#countComponents%28%29), [deliverEvent](../../java/awt/Container.html#deliverEvent%28java.awt.Event%29), [doLayout](../../java/awt/Container.html#doLayout%28%29), [findComponentAt](../../java/awt/Container.html#findComponentAt%28int,int%29), [findComponentAt](../../java/awt/Container.html#findComponentAt%28java.awt.Point%29), [getComponent](../../java/awt/Container.html#getComponent%28int%29), [getComponentAt](../../java/awt/Container.html#getComponentAt%28int,int%29), [getComponentAt](../../java/awt/Container.html#getComponentAt%28java.awt.Point%29), [getComponentCount](../../java/awt/Container.html#getComponentCount%28%29), [getComponents](../../java/awt/Container.html#getComponents%28%29), [getComponentZOrder](../../java/awt/Container.html#getComponentZOrder%28java.awt.Component%29), [getContainerListeners](../../java/awt/Container.html#getContainerListeners%28%29), [getFocusTraversalKeys](../../java/awt/Container.html#getFocusTraversalKeys%28int%29), [getFocusTraversalPolicy](../../java/awt/Container.html#getFocusTraversalPolicy%28%29), [getLayout](../../java/awt/Container.html#getLayout%28%29), [getMousePosition](../../java/awt/Container.html#getMousePosition%28boolean%29), [insets](../../java/awt/Container.html#insets%28%29), [invalidate](../../java/awt/Container.html#invalidate%28%29), [isAncestorOf](../../java/awt/Container.html#isAncestorOf%28java.awt.Component%29), [isFocusCycleRoot](../../java/awt/Container.html#isFocusCycleRoot%28java.awt.Container%29), [isFocusTraversalPolicyProvider](../../java/awt/Container.html#isFocusTraversalPolicyProvider%28%29), [isFocusTraversalPolicySet](../../java/awt/Container.html#isFocusTraversalPolicySet%28%29), [layout](../../java/awt/Container.html#layout%28%29), [list](../../java/awt/Container.html#list%28java.io.PrintStream,int%29), [list](../../java/awt/Container.html#list%28java.io.PrintWriter,int%29), [locate](../../java/awt/Container.html#locate%28int,int%29), [minimumSize](../../java/awt/Container.html#minimumSize%28%29), [paintComponents](../../java/awt/Container.html#paintComponents%28java.awt.Graphics%29), [preferredSize](../../java/awt/Container.html#preferredSize%28%29), [printComponents](../../java/awt/Container.html#printComponents%28java.awt.Graphics%29), [processContainerEvent](../../java/awt/Container.html#processContainerEvent%28java.awt.event.ContainerEvent%29), [processEvent](../../java/awt/Container.html#processEvent%28java.awt.AWTEvent%29), [remove](../../java/awt/Container.html#remove%28int%29), [removeAll](../../java/awt/Container.html#removeAll%28%29), [removeContainerListener](../../java/awt/Container.html#removeContainerListener%28java.awt.event.ContainerListener%29), [setComponentZOrder](../../java/awt/Container.html#setComponentZOrder%28java.awt.Component,int%29), [setFocusTraversalPolicy](../../java/awt/Container.html#setFocusTraversalPolicy%28java.awt.FocusTraversalPolicy%29), [setFocusTraversalPolicyProvider](../../java/awt/Container.html#setFocusTraversalPolicyProvider%28boolean%29), [transferFocusDownCycle](../../java/awt/Container.html#transferFocusDownCycle%28%29), [validate](../../java/awt/Container.html#validate%28%29), [validateTree](../../java/awt/Container.html#validateTree%28%29)
Methods declared in class java.awt.Component
[action](../../java/awt/Component.html#action%28java.awt.Event,java.lang.Object%29), [add](../../java/awt/Component.html#add%28java.awt.PopupMenu%29), [addComponentListener](../../java/awt/Component.html#addComponentListener%28java.awt.event.ComponentListener%29), [addFocusListener](../../java/awt/Component.html#addFocusListener%28java.awt.event.FocusListener%29), [addHierarchyBoundsListener](../../java/awt/Component.html#addHierarchyBoundsListener%28java.awt.event.HierarchyBoundsListener%29), [addHierarchyListener](../../java/awt/Component.html#addHierarchyListener%28java.awt.event.HierarchyListener%29), [addInputMethodListener](../../java/awt/Component.html#addInputMethodListener%28java.awt.event.InputMethodListener%29), [addKeyListener](../../java/awt/Component.html#addKeyListener%28java.awt.event.KeyListener%29), [addMouseListener](../../java/awt/Component.html#addMouseListener%28java.awt.event.MouseListener%29), [addMouseMotionListener](../../java/awt/Component.html#addMouseMotionListener%28java.awt.event.MouseMotionListener%29), [addMouseWheelListener](../../java/awt/Component.html#addMouseWheelListener%28java.awt.event.MouseWheelListener%29), [bounds](../../java/awt/Component.html#bounds%28%29), [checkImage](../../java/awt/Component.html#checkImage%28java.awt.Image,int,int,java.awt.image.ImageObserver%29), [checkImage](../../java/awt/Component.html#checkImage%28java.awt.Image,java.awt.image.ImageObserver%29), [coalesceEvents](../../java/awt/Component.html#coalesceEvents%28java.awt.AWTEvent,java.awt.AWTEvent%29), [contains](../../java/awt/Component.html#contains%28java.awt.Point%29), [createImage](../../java/awt/Component.html#createImage%28int,int%29), [createImage](../../java/awt/Component.html#createImage%28java.awt.image.ImageProducer%29), [createVolatileImage](../../java/awt/Component.html#createVolatileImage%28int,int%29), [createVolatileImage](../../java/awt/Component.html#createVolatileImage%28int,int,java.awt.ImageCapabilities%29), [disableEvents](../../java/awt/Component.html#disableEvents%28long%29), [dispatchEvent](../../java/awt/Component.html#dispatchEvent%28java.awt.AWTEvent%29), [enable](../../java/awt/Component.html#enable%28boolean%29), [enableEvents](../../java/awt/Component.html#enableEvents%28long%29), [enableInputMethods](../../java/awt/Component.html#enableInputMethods%28boolean%29), [firePropertyChange](../../java/awt/Component.html#firePropertyChange%28java.lang.String,byte,byte%29), [firePropertyChange](../../java/awt/Component.html#firePropertyChange%28java.lang.String,char,char%29), [firePropertyChange](../../java/awt/Component.html#firePropertyChange%28java.lang.String,double,double%29), [firePropertyChange](../../java/awt/Component.html#firePropertyChange%28java.lang.String,float,float%29), [firePropertyChange](../../java/awt/Component.html#firePropertyChange%28java.lang.String,long,long%29), [firePropertyChange](../../java/awt/Component.html#firePropertyChange%28java.lang.String,short,short%29), [firePropertyChange](../../java/awt/Component.html#firePropertyChange%28java.lang.String,java.lang.Object,java.lang.Object%29), [getBackground](../../java/awt/Component.html#getBackground%28%29), [getBounds](../../java/awt/Component.html#getBounds%28%29), [getColorModel](../../java/awt/Component.html#getColorModel%28%29), [getComponentListeners](../../java/awt/Component.html#getComponentListeners%28%29), [getComponentOrientation](../../java/awt/Component.html#getComponentOrientation%28%29), [getCursor](../../java/awt/Component.html#getCursor%28%29), [getDropTarget](../../java/awt/Component.html#getDropTarget%28%29), [getFocusListeners](../../java/awt/Component.html#getFocusListeners%28%29), [getFocusTraversalKeysEnabled](../../java/awt/Component.html#getFocusTraversalKeysEnabled%28%29), [getFont](../../java/awt/Component.html#getFont%28%29), [getForeground](../../java/awt/Component.html#getForeground%28%29), [getGraphicsConfiguration](../../java/awt/Component.html#getGraphicsConfiguration%28%29), [getHierarchyBoundsListeners](../../java/awt/Component.html#getHierarchyBoundsListeners%28%29), [getHierarchyListeners](../../java/awt/Component.html#getHierarchyListeners%28%29), [getIgnoreRepaint](../../java/awt/Component.html#getIgnoreRepaint%28%29), [getInputContext](../../java/awt/Component.html#getInputContext%28%29), [getInputMethodListeners](../../java/awt/Component.html#getInputMethodListeners%28%29), [getInputMethodRequests](../../java/awt/Component.html#getInputMethodRequests%28%29), [getKeyListeners](../../java/awt/Component.html#getKeyListeners%28%29), [getLocale](../../java/awt/Component.html#getLocale%28%29), [getLocation](../../java/awt/Component.html#getLocation%28%29), [getLocationOnScreen](../../java/awt/Component.html#getLocationOnScreen%28%29), [getMouseListeners](../../java/awt/Component.html#getMouseListeners%28%29), [getMouseMotionListeners](../../java/awt/Component.html#getMouseMotionListeners%28%29), [getMousePosition](../../java/awt/Component.html#getMousePosition%28%29), [getMouseWheelListeners](../../java/awt/Component.html#getMouseWheelListeners%28%29), [getName](../../java/awt/Component.html#getName%28%29), [getParent](../../java/awt/Component.html#getParent%28%29), [getPropertyChangeListeners](../../java/awt/Component.html#getPropertyChangeListeners%28%29), [getPropertyChangeListeners](../../java/awt/Component.html#getPropertyChangeListeners%28java.lang.String%29), [getSize](../../java/awt/Component.html#getSize%28%29), [getToolkit](../../java/awt/Component.html#getToolkit%28%29), [getTreeLock](../../java/awt/Component.html#getTreeLock%28%29), [gotFocus](../../java/awt/Component.html#gotFocus%28java.awt.Event,java.lang.Object%29), [handleEvent](../../java/awt/Component.html#handleEvent%28java.awt.Event%29), [hasFocus](../../java/awt/Component.html#hasFocus%28%29), [imageUpdate](../../java/awt/Component.html#imageUpdate%28java.awt.Image,int,int,int,int,int%29), [inside](../../java/awt/Component.html#inside%28int,int%29), [isBackgroundSet](../../java/awt/Component.html#isBackgroundSet%28%29), [isCursorSet](../../java/awt/Component.html#isCursorSet%28%29), [isDisplayable](../../java/awt/Component.html#isDisplayable%28%29), [isEnabled](../../java/awt/Component.html#isEnabled%28%29), [isFocusable](../../java/awt/Component.html#isFocusable%28%29), [isFocusOwner](../../java/awt/Component.html#isFocusOwner%28%29), [isFocusTraversable](../../java/awt/Component.html#isFocusTraversable%28%29), [isFontSet](../../java/awt/Component.html#isFontSet%28%29), [isForegroundSet](../../java/awt/Component.html#isForegroundSet%28%29), [isLightweight](../../java/awt/Component.html#isLightweight%28%29), [isMaximumSizeSet](../../java/awt/Component.html#isMaximumSizeSet%28%29), [isMinimumSizeSet](../../java/awt/Component.html#isMinimumSizeSet%28%29), [isPreferredSizeSet](../../java/awt/Component.html#isPreferredSizeSet%28%29), [isShowing](../../java/awt/Component.html#isShowing%28%29), [isValid](../../java/awt/Component.html#isValid%28%29), [isVisible](../../java/awt/Component.html#isVisible%28%29), [keyDown](../../java/awt/Component.html#keyDown%28java.awt.Event,int%29), [keyUp](../../java/awt/Component.html#keyUp%28java.awt.Event,int%29), [list](../../java/awt/Component.html#list%28%29), [list](../../java/awt/Component.html#list%28java.io.PrintStream%29), [list](../../java/awt/Component.html#list%28java.io.PrintWriter%29), [location](../../java/awt/Component.html#location%28%29), [lostFocus](../../java/awt/Component.html#lostFocus%28java.awt.Event,java.lang.Object%29), [mouseDown](../../java/awt/Component.html#mouseDown%28java.awt.Event,int,int%29), [mouseDrag](../../java/awt/Component.html#mouseDrag%28java.awt.Event,int,int%29), [mouseEnter](../../java/awt/Component.html#mouseEnter%28java.awt.Event,int,int%29), [mouseExit](../../java/awt/Component.html#mouseExit%28java.awt.Event,int,int%29), [mouseMove](../../java/awt/Component.html#mouseMove%28java.awt.Event,int,int%29), [mouseUp](../../java/awt/Component.html#mouseUp%28java.awt.Event,int,int%29), [move](../../java/awt/Component.html#move%28int,int%29), [nextFocus](../../java/awt/Component.html#nextFocus%28%29), [paintAll](../../java/awt/Component.html#paintAll%28java.awt.Graphics%29), [postEvent](../../java/awt/Component.html#postEvent%28java.awt.Event%29), [prepareImage](../../java/awt/Component.html#prepareImage%28java.awt.Image,int,int,java.awt.image.ImageObserver%29), [prepareImage](../../java/awt/Component.html#prepareImage%28java.awt.Image,java.awt.image.ImageObserver%29), [processComponentEvent](../../java/awt/Component.html#processComponentEvent%28java.awt.event.ComponentEvent%29), [processFocusEvent](../../java/awt/Component.html#processFocusEvent%28java.awt.event.FocusEvent%29), [processHierarchyBoundsEvent](../../java/awt/Component.html#processHierarchyBoundsEvent%28java.awt.event.HierarchyEvent%29), [processHierarchyEvent](../../java/awt/Component.html#processHierarchyEvent%28java.awt.event.HierarchyEvent%29), [processInputMethodEvent](../../java/awt/Component.html#processInputMethodEvent%28java.awt.event.InputMethodEvent%29), [processMouseWheelEvent](../../java/awt/Component.html#processMouseWheelEvent%28java.awt.event.MouseWheelEvent%29), [remove](../../java/awt/Component.html#remove%28java.awt.MenuComponent%29), [removeComponentListener](../../java/awt/Component.html#removeComponentListener%28java.awt.event.ComponentListener%29), [removeFocusListener](../../java/awt/Component.html#removeFocusListener%28java.awt.event.FocusListener%29), [removeHierarchyBoundsListener](../../java/awt/Component.html#removeHierarchyBoundsListener%28java.awt.event.HierarchyBoundsListener%29), [removeHierarchyListener](../../java/awt/Component.html#removeHierarchyListener%28java.awt.event.HierarchyListener%29), [removeInputMethodListener](../../java/awt/Component.html#removeInputMethodListener%28java.awt.event.InputMethodListener%29), [removeKeyListener](../../java/awt/Component.html#removeKeyListener%28java.awt.event.KeyListener%29), [removeMouseListener](../../java/awt/Component.html#removeMouseListener%28java.awt.event.MouseListener%29), [removeMouseMotionListener](../../java/awt/Component.html#removeMouseMotionListener%28java.awt.event.MouseMotionListener%29), [removeMouseWheelListener](../../java/awt/Component.html#removeMouseWheelListener%28java.awt.event.MouseWheelListener%29), [removePropertyChangeListener](../../java/awt/Component.html#removePropertyChangeListener%28java.beans.PropertyChangeListener%29), [removePropertyChangeListener](../../java/awt/Component.html#removePropertyChangeListener%28java.lang.String,java.beans.PropertyChangeListener%29), [repaint](../../java/awt/Component.html#repaint%28%29), [repaint](../../java/awt/Component.html#repaint%28int,int,int,int%29), [repaint](../../java/awt/Component.html#repaint%28long%29), [requestFocus](../../java/awt/Component.html#requestFocus%28boolean,java.awt.event.FocusEvent.Cause%29), [requestFocus](../../java/awt/Component.html#requestFocus%28java.awt.event.FocusEvent.Cause%29), [requestFocusInWindow](../../java/awt/Component.html#requestFocusInWindow%28java.awt.event.FocusEvent.Cause%29), [resize](../../java/awt/Component.html#resize%28int,int%29), [resize](../../java/awt/Component.html#resize%28java.awt.Dimension%29), [setBounds](../../java/awt/Component.html#setBounds%28int,int,int,int%29), [setBounds](../../java/awt/Component.html#setBounds%28java.awt.Rectangle%29), [setComponentOrientation](../../java/awt/Component.html#setComponentOrientation%28java.awt.ComponentOrientation%29), [setDropTarget](../../java/awt/Component.html#setDropTarget%28java.awt.dnd.DropTarget%29), [setFocusable](../../java/awt/Component.html#setFocusable%28boolean%29), [setFocusTraversalKeysEnabled](../../java/awt/Component.html#setFocusTraversalKeysEnabled%28boolean%29), [setIgnoreRepaint](../../java/awt/Component.html#setIgnoreRepaint%28boolean%29), [setLocale](../../java/awt/Component.html#setLocale%28java.util.Locale%29), [setLocation](../../java/awt/Component.html#setLocation%28int,int%29), [setLocation](../../java/awt/Component.html#setLocation%28java.awt.Point%29), [setMixingCutoutShape](../../java/awt/Component.html#setMixingCutoutShape%28java.awt.Shape%29), [setName](../../java/awt/Component.html#setName%28java.lang.String%29), [setSize](../../java/awt/Component.html#setSize%28int,int%29), [setSize](../../java/awt/Component.html#setSize%28java.awt.Dimension%29), [show](../../java/awt/Component.html#show%28boolean%29), [size](../../java/awt/Component.html#size%28%29), [toString](../../java/awt/Component.html#toString%28%29), [transferFocus](../../java/awt/Component.html#transferFocus%28%29), [transferFocusBackward](../../java/awt/Component.html#transferFocusBackward%28%29), [transferFocusUpCycle](../../java/awt/Component.html#transferFocusUpCycle%28%29)
Field Details
rootPane
The
JRootPane
instance that manages the content pane and optional menu bar for this internal frame, as well as the glass pane.
See Also:
JRootPane, RootPaneContainerrootPaneCheckingEnabled
protected boolean rootPaneCheckingEnabled
If true then calls toadd
andsetLayout
will be forwarded to thecontentPane
. This is initially false, but is set to true when theJInternalFrame
is constructed.
See Also:
isRootPaneCheckingEnabled(), setRootPaneCheckingEnabled(boolean), RootPaneContainerclosable
protected boolean closable
The frame can be closed.isClosed
protected boolean isClosed
The frame has been closed.maximizable
protected boolean maximizable
The frame can be expanded to the size of the desktop pane.isMaximum
protected boolean isMaximum
The frame has been expanded to its maximum size.
See Also:
maximizableiconable
protected boolean iconable
The frame can "iconified" (shrunk down and displayed as an icon-image).
See Also:
JInternalFrame.JDesktopIcon, setIconifiable(boolean)isIcon
protected boolean isIcon
The frame has been iconified.
See Also:
isIcon()resizable
protected boolean resizable
The frame's size can be changed.isSelected
protected boolean isSelected
The frame is currently selected.frameIcon
protected Icon frameIcon
The icon shown in the top-left corner of this internal frame.title
The title displayed in this internal frame's title bar.
desktopIcon
The icon that is displayed when this internal frame is iconified.
See Also:
iconableCONTENT_PANE_PROPERTY
public static final String CONTENT_PANE_PROPERTY
Bound property name.
See Also:
Constant Field ValuesTITLE_PROPERTY
public static final String TITLE_PROPERTY
Bound property name.
See Also:
Constant Field ValuesLAYERED_PANE_PROPERTY
public static final String LAYERED_PANE_PROPERTY
Bound property name.
See Also:
Constant Field ValuesROOT_PANE_PROPERTY
public static final String ROOT_PANE_PROPERTY
Bound property name.
See Also:
Constant Field ValuesGLASS_PANE_PROPERTY
public static final String GLASS_PANE_PROPERTY
Bound property name.
See Also:
Constant Field ValuesFRAME_ICON_PROPERTY
public static final String FRAME_ICON_PROPERTY
Bound property name.
See Also:
Constant Field ValuesIS_SELECTED_PROPERTY
public static final String IS_SELECTED_PROPERTY
Constrained property name indicated that this frame has selected status.
See Also:
Constant Field ValuesIS_CLOSED_PROPERTY
public static final String IS_CLOSED_PROPERTY
Constrained property name indicating that the internal frame is closed.
See Also:
Constant Field ValuesIS_MAXIMUM_PROPERTY
public static final String IS_MAXIMUM_PROPERTY
Constrained property name indicating that the internal frame is maximized.
See Also:
Constant Field ValuesIS_ICON_PROPERTY
public static final String IS_ICON_PROPERTY
Constrained property name indicating that the internal frame is iconified.
See Also:
Constant Field ValuesConstructor Details
JInternalFrame
public JInternalFrame()
Creates a non-resizable, non-closable, non-maximizable, non-iconifiableJInternalFrame
with no title.JInternalFrame
public JInternalFrame(String title)
Creates a non-resizable, non-closable, non-maximizable, non-iconifiableJInternalFrame
with the specified title. Note that passing in anull
title
results in unspecified behavior and possibly an exception.
Parameters:
title
- the non-null
String
to display in the title barJInternalFrame
public JInternalFrame(String title, boolean resizable)
Creates a non-closable, non-maximizable, non-iconifiableJInternalFrame
with the specified title and resizability.
Parameters:
title
- theString
to display in the title bar
resizable
- iftrue
, the internal frame can be resizedJInternalFrame
public JInternalFrame(String title, boolean resizable, boolean closable)
Creates a non-maximizable, non-iconifiableJInternalFrame
with the specified title, resizability, and closability.
Parameters:
title
- theString
to display in the title bar
resizable
- iftrue
, the internal frame can be resized
closable
- iftrue
, the internal frame can be closedJInternalFrame
public JInternalFrame(String title, boolean resizable, boolean closable, boolean maximizable)
Creates a non-iconifiableJInternalFrame
with the specified title, resizability, closability, and maximizability.
Parameters:
title
- theString
to display in the title bar
resizable
- iftrue
, the internal frame can be resized
closable
- iftrue
, the internal frame can be closed
maximizable
- iftrue
, the internal frame can be maximizedJInternalFrame
public JInternalFrame(String title, boolean resizable, boolean closable, boolean maximizable, boolean iconifiable)
Creates aJInternalFrame
with the specified title, resizability, closability, maximizability, and iconifiability. AllJInternalFrame
constructors use this one.
Parameters:
title
- theString
to display in the title bar
resizable
- iftrue
, the internal frame can be resized
closable
- iftrue
, the internal frame can be closed
maximizable
- iftrue
, the internal frame can be maximized
iconifiable
- iftrue
, the internal frame can be iconifiedMethod Details
createRootPane
Called by the constructor to set up the
JRootPane
.
Returns:
a newJRootPane
See Also:
JRootPanegetUI
Returns the look-and-feel object that renders this component.
Overrides:
[getUI](JComponent.html#getUI%28%29)
in class[JComponent](JComponent.html "class in javax.swing")
Returns:
theInternalFrameUI
object that renders this componentsetUI
Sets the UI delegate for this
JInternalFrame
.
Parameters:
ui
- the UI delegateupdateUI
public void updateUI()
Notification from theUIManager
that the look and feel has changed. Replaces the current UI object with the latest version from theUIManager
.
Overrides:
[updateUI](JComponent.html#updateUI%28%29)
in class[JComponent](JComponent.html "class in javax.swing")
See Also:
JComponent.updateUI()getUIClassID
Returns the name of the look-and-feel class that renders this component.
Overrides:
[getUIClassID](JComponent.html#getUIClassID%28%29)
in class[JComponent](JComponent.html "class in javax.swing")
Returns:
the string "InternalFrameUI"
See Also:
JComponent.getUIClassID(), UIDefaults.getUI(javax.swing.JComponent)isRootPaneCheckingEnabled
protected boolean isRootPaneCheckingEnabled()
Returns whether calls toadd
andsetLayout
are forwarded to thecontentPane
.
Returns:
true ifadd
andsetLayout
are forwarded; false otherwise
See Also:
addImpl(java.awt.Component, java.lang.Object, int), setLayout(java.awt.LayoutManager), setRootPaneCheckingEnabled(boolean), RootPaneContainersetRootPaneCheckingEnabled
@BeanProperty(hidden=true,description="Whether the add and setLayout methods are forwarded")protected void setRootPaneCheckingEnabled(boolean enabled)
Sets whether calls toadd
andsetLayout
are forwarded to thecontentPane
.
Parameters:
enabled
- true ifadd
andsetLayout
are forwarded, false if they should operate directly on theJInternalFrame
.
See Also:
addImpl(java.awt.Component, java.lang.Object, int), setLayout(java.awt.LayoutManager), isRootPaneCheckingEnabled(), RootPaneContaineraddImpl
protected void addImpl(Component comp,Object constraints, int index)
Adds the specified childComponent
. This method is overridden to conditionally forward calls to thecontentPane
. By default, children are added to thecontentPane
instead of the frame, refer to RootPaneContainer for details.
Overrides:
[addImpl](../../java/awt/Container.html#addImpl%28java.awt.Component,java.lang.Object,int%29)
in class[Container](../../java/awt/Container.html "class in java.awt")
Parameters:
comp
- the component to be enhanced
constraints
- the constraints to be respected
index
- the index
Throws:
[IllegalArgumentException](../../../java.base/java/lang/IllegalArgumentException.html "class in java.lang")
- ifindex
is invalid
[IllegalArgumentException](../../../java.base/java/lang/IllegalArgumentException.html "class in java.lang")
- if adding the container's parent to itself
[IllegalArgumentException](../../../java.base/java/lang/IllegalArgumentException.html "class in java.lang")
- if adding a window to a container
See Also:
setRootPaneCheckingEnabled(boolean), RootPaneContainerremove
Removes the specified component from the container. If
comp
is not a child of theJInternalFrame
this will forward the call to thecontentPane
.
Overrides:
[remove](../../java/awt/Container.html#remove%28java.awt.Component%29)
in class[Container](../../java/awt/Container.html "class in java.awt")
Parameters:
comp
- the component to be removed
Throws:
[NullPointerException](../../../java.base/java/lang/NullPointerException.html "class in java.lang")
- ifcomp
is null
See Also:
Container.add(java.awt.Component), RootPaneContainersetLayout
Ensures that, by default, the layout of this component cannot be set. Overridden to conditionally forward the call to the
contentPane
. Refer to RootPaneContainer for more information.
Overrides:
[setLayout](../../java/awt/Container.html#setLayout%28java.awt.LayoutManager%29)
in class[Container](../../java/awt/Container.html "class in java.awt")
Parameters:
manager
- theLayoutManager
See Also:
setRootPaneCheckingEnabled(boolean)getContentPane
Returns the content pane for this internal frame.
Specified by:
[getContentPane](RootPaneContainer.html#getContentPane%28%29)
in interface[RootPaneContainer](RootPaneContainer.html "interface in javax.swing")
Returns:
the content pane
See Also:
RootPaneContainer.setContentPane(java.awt.Container)setContentPane
@BeanProperty(hidden=true,description="The client area of the internal frame where child components are normally inserted.")public void setContentPane(Container c)
Sets thisJInternalFrame
'scontentPane
property.
Specified by:
[setContentPane](RootPaneContainer.html#setContentPane%28java.awt.Container%29)
in interface[RootPaneContainer](RootPaneContainer.html "interface in javax.swing")
Parameters:
c
- the content pane for this internal frame
Throws:
[IllegalComponentStateException](../../java/awt/IllegalComponentStateException.html "class in java.awt")
- (a runtime exception) if the content pane parameter isnull
See Also:
RootPaneContainer.getContentPane()getLayeredPane
Returns the layered pane for this internal frame.
Specified by:
[getLayeredPane](RootPaneContainer.html#getLayeredPane%28%29)
in interface[RootPaneContainer](RootPaneContainer.html "interface in javax.swing")
Returns:
aJLayeredPane
object
See Also:
RootPaneContainer.setLayeredPane(javax.swing.JLayeredPane), RootPaneContainer.getLayeredPane()setLayeredPane
Sets this
JInternalFrame
'slayeredPane
property.
Specified by:
[setLayeredPane](RootPaneContainer.html#setLayeredPane%28javax.swing.JLayeredPane%29)
in interface[RootPaneContainer](RootPaneContainer.html "interface in javax.swing")
Parameters:
layered
- theJLayeredPane
for this internal frame
Throws:
[IllegalComponentStateException](../../java/awt/IllegalComponentStateException.html "class in java.awt")
- (a runtime exception) if the layered pane parameter isnull
See Also:
RootPaneContainer.setLayeredPane(javax.swing.JLayeredPane)getGlassPane
Returns the glass pane for this internal frame.
Specified by:
[getGlassPane](RootPaneContainer.html#getGlassPane%28%29)
in interface[RootPaneContainer](RootPaneContainer.html "interface in javax.swing")
Returns:
the glass pane
See Also:
RootPaneContainer.setGlassPane(java.awt.Component)setGlassPane
Sets this
JInternalFrame
'sglassPane
property.
Specified by:
[setGlassPane](RootPaneContainer.html#setGlassPane%28java.awt.Component%29)
in interface[RootPaneContainer](RootPaneContainer.html "interface in javax.swing")
Parameters:
glass
- the glass pane for this internal frame
See Also:
RootPaneContainer.getGlassPane()getRootPane
Returns the
rootPane
object for this internal frame.
Specified by:
[getRootPane](RootPaneContainer.html#getRootPane%28%29)
in interface[RootPaneContainer](RootPaneContainer.html "interface in javax.swing")
Overrides:
[getRootPane](JComponent.html#getRootPane%28%29)
in class[JComponent](JComponent.html "class in javax.swing")
Returns:
therootPane
property
See Also:
RootPaneContainer.getRootPane()setRootPane
protected void setRootPane(JRootPane root)
Sets therootPane
property for thisJInternalFrame
. This method is called by the constructor.
Parameters:
root
- the newJRootPane
objectsetClosable
@BeanProperty(preferred=true,description="Indicates whether this internal frame can be closed.")public void setClosable(boolean b)
Sets whether thisJInternalFrame
can be closed by some user action.
Parameters:
b
- a boolean value, wheretrue
means this internal frame can be closedisClosable
public boolean isClosable()
Returns whether thisJInternalFrame
can be closed by some user action.
Returns:
true
if this internal frame can be closedisClosed
public boolean isClosed()
Returns whether thisJInternalFrame
is currently closed.
Returns:
true
if this internal frame is closed,false
otherwisesetClosed
Closes this internal frame if the argument is
true
. Do not invoke this method with afalse
argument; the result of invokingsetClosed(false)
is unspecified.
If the internal frame is already closed, this method does nothing and returns immediately. Otherwise, this method begins by firing anINTERNAL_FRAME_CLOSING
event. Then this method sets theclosed
property totrue
unless a listener vetoes the property change. This method finishes by making the internal frame invisible and unselected, and then firing anINTERNAL_FRAME_CLOSED
event.
Note: To reuse an internal frame that has been closed, you must add it to a container (even if you never removed it from its previous container). Typically, this container will be theJDesktopPane
that previously contained the internal frame.
Parameters:
b
- must betrue
Throws:
[PropertyVetoException](../../java/beans/PropertyVetoException.html "class in java.beans")
- when the attempt to set the property is vetoed by theJInternalFrame
See Also:
isClosed(), setDefaultCloseOperation(int), dispose(), InternalFrameEvent.INTERNAL_FRAME_CLOSINGsetResizable
@BeanProperty(preferred=true,description="Determines whether this internal frame can be resized by the user.")public void setResizable(boolean b)
Sets whether theJInternalFrame
can be resized by some user action.
Parameters:
b
- a boolean, wheretrue
means this internal frame can be resizedisResizable
public boolean isResizable()
Returns whether theJInternalFrame
can be resized by some user action.
Returns:
true
if this internal frame can be resized,false
otherwisesetIconifiable
@BeanProperty(preferred=true,description="Determines whether this internal frame can be iconified.")public void setIconifiable(boolean b)
Sets theiconable
property, which must betrue
for the user to be able to make theJInternalFrame
an icon. Some look and feels might not implement iconification; they will ignore this property.
Parameters:
b
- a boolean, wheretrue
means this internal frame can be iconifiedisIconifiable
public boolean isIconifiable()
Gets theiconable
property, which by default isfalse
.
Returns:
the value of theiconable
property.
See Also:
setIconifiable(boolean)isIcon
public boolean isIcon()
Returns whether theJInternalFrame
is currently iconified.
Returns:
true
if this internal frame is iconifiedsetIcon
Iconifies or de-iconifies this internal frame, if the look and feel supports iconification. If the internal frame's state changes to iconified, this method fires an
INTERNAL_FRAME_ICONIFIED
event. If the state changes to de-iconified, anINTERNAL_FRAME_DEICONIFIED
event is fired.
Parameters:
b
- a boolean, wheretrue
means to iconify this internal frame andfalse
means to de-iconify it
Throws:
[PropertyVetoException](../../java/beans/PropertyVetoException.html "class in java.beans")
- when the attempt to set the property is vetoed by theJInternalFrame
See Also:
InternalFrameEvent.INTERNAL_FRAME_ICONIFIED, InternalFrameEvent.INTERNAL_FRAME_DEICONIFIEDsetMaximizable
@BeanProperty(preferred=true,description="Determines whether this internal frame can be maximized.")public void setMaximizable(boolean b)
Sets themaximizable
property, which determines whether theJInternalFrame
can be maximized by some user action. Some look and feels might not support maximizing internal frames; they will ignore this property.
Parameters:
b
-true
to specify that this internal frame should be maximizable;false
to specify that it should not beisMaximizable
public boolean isMaximizable()
Gets the value of themaximizable
property.
Returns:
the value of themaximizable
property
See Also:
setMaximizable(boolean)isMaximum
public boolean isMaximum()
Returns whether theJInternalFrame
is currently maximized.
Returns:
true
if this internal frame is maximized,false
otherwisesetMaximum
Maximizes and restores this internal frame. A maximized frame is resized to fully fit the
JDesktopPane
area associated with theJInternalFrame
. A restored frame's size is set to theJInternalFrame
's actual size.
Parameters:
b
- a boolean, wheretrue
maximizes this internal frame andfalse
restores it
Throws:
[PropertyVetoException](../../java/beans/PropertyVetoException.html "class in java.beans")
- when the attempt to set the property is vetoed by theJInternalFrame
getTitle
Returns the title of the
JInternalFrame
.
Returns:
aString
containing this internal frame's title
See Also:
setTitle(java.lang.String)setTitle
Sets the
JInternalFrame
title.title
may have anull
value.
Parameters:
title
- theString
to display in the title bar
See Also:
getTitle()setSelected
Selects or deselects the internal frame if it's showing. A
JInternalFrame
normally draws its title bar differently if it is the selected frame, which indicates to the user that this internal frame has the focus. When this method changes the state of the internal frame from deselected to selected, it fires anInternalFrameEvent.INTERNAL_FRAME_ACTIVATED
event. If the change is from selected to deselected, anInternalFrameEvent.INTERNAL_FRAME_DEACTIVATED
event is fired.
Parameters:
selected
- a boolean, wheretrue
means this internal frame should become selected (currently active) andfalse
means it should become deselected
Throws:
[PropertyVetoException](../../java/beans/PropertyVetoException.html "class in java.beans")
- when the attempt to set the property is vetoed by theJInternalFrame
See Also:
Component.isShowing(), InternalFrameEvent.INTERNAL_FRAME_ACTIVATED, InternalFrameEvent.INTERNAL_FRAME_DEACTIVATEDisSelected
public boolean isSelected()
Returns whether theJInternalFrame
is the currently "selected" or active frame.
Returns:
true
if this internal frame is currently selected (active)
See Also:
setSelected(boolean)setFrameIcon
@BeanProperty(description="The icon shown in the top-left corner of this internal frame.")public void setFrameIcon(Icon icon)
Sets an image to be displayed in the titlebar of this internal frame (usually in the top-left corner). Some look and feels might not support displaying an icon in the titlebar. This image is not thedesktopIcon
object, which is the image displayed in theJDesktop
when this internal frame is iconified. Passingnull
to this function is valid, but the look and feel can choose the appropriate behavior for that situation, such as displaying no icon or a default icon for the look and feel.
Parameters:
icon
- theIcon
to display in the title bar
See Also:
getFrameIcon()getFrameIcon
public Icon getFrameIcon()
Returns the image displayed in the title bar of this internal frame (usually in the top-left corner).
Returns:
theIcon
displayed in the title bar
See Also:
setFrameIcon(javax.swing.Icon)moveToFront
public void moveToFront()
Convenience method that moves this component to position 0 if its parent is aJLayeredPane
.moveToBack
public void moveToBack()
Convenience method that moves this component to position -1 if its parent is aJLayeredPane
.getLastCursor
Returns the last
Cursor
that was set by thesetCursor
method that is not a resizableCursor
.
Returns:
the last non-resizableCursor
Since:
1.6setCursor
public void setCursor(Cursor cursor)
Sets the cursor image to the specified cursor. This cursor image is displayed when thecontains
method for this component returns true for the current cursor location, and this Component is visible, displayable, and enabled. Setting the cursor of aContainer
causes that cursor to be displayed within all of the container's subcomponents, except for those that have a non-null
cursor.
The method may have no visual effect if the Java platform implementation and/or the native system do not support changing the mouse cursor shape.
Overrides:
[setCursor](../../java/awt/Component.html#setCursor%28java.awt.Cursor%29)
in class[Component](../../java/awt/Component.html "class in java.awt")
Parameters:
cursor
- One of the constants defined by theCursor
class; if this parameter isnull
then this component will inherit the cursor of its parent
Since:
1.6
See Also:
Component.isEnabled(), Component.isShowing(), Component.getCursor(), Component.contains(int, int), Toolkit.createCustomCursor(java.awt.Image, java.awt.Point, java.lang.String), CursorsetLayer
Convenience method for setting the layer attribute of this component.
Parameters:
layer
- anInteger
object specifying this frame's desktop layer
Throws:
[NullPointerException](../../../java.base/java/lang/NullPointerException.html "class in java.lang")
- iflayer
isnull
See Also:
JLayeredPanesetLayer
Convenience method for setting the layer attribute of this component. The method
setLayer(Integer)
should be used for layer values predefined inJLayeredPane
. When usingsetLayer(int)
, care must be taken not to accidentally clash with those values.
Parameters:
layer
- an integer specifying this internal frame's desktop layer
Since:
1.3
See Also:
setLayer(Integer), JLayeredPanegetLayer
public int getLayer()
Convenience method for getting the layer attribute of this component.
Returns:
anInteger
object specifying this frame's desktop layer
See Also:
JLayeredPanegetDesktopPane
Convenience method that searches the ancestor hierarchy for a
JDesktop
instance. IfJInternalFrame
finds none, thedesktopIcon
tree is searched.
Returns:
theJDesktopPane
this internal frame belongs to, ornull
if none is foundsetDesktopIcon
Sets the
JDesktopIcon
associated with thisJInternalFrame
.
Parameters:
d
- theJDesktopIcon
to display on the desktop
See Also:
getDesktopIcon()getDesktopIcon
Returns the
JDesktopIcon
used when thisJInternalFrame
is iconified.
Returns:
theJDesktopIcon
displayed on the desktop
See Also:
setDesktopIcon(javax.swing.JInternalFrame.JDesktopIcon)getNormalBounds
If the
JInternalFrame
is not in maximized state, returnsgetBounds()
; otherwise, returns the bounds that theJInternalFrame
would be restored to.
Returns:
aRectangle
containing the bounds of this frame when in the normal state
Since:
1.3setNormalBounds
public void setNormalBounds(Rectangle r)
Sets the normal bounds for this internal frame, the bounds that this internal frame would be restored to from its maximized state. This method is intended for use only by desktop managers.
Parameters:
r
- the bounds that this internal frame should be restored to
Since:
1.3getFocusOwner
If this
JInternalFrame
is active, returns the child that has focus. Otherwise, returnsnull
.
Returns:
the component with focus, ornull
if no children have focus
Since:
1.3getMostRecentFocusOwner
Returns the child component of this
JInternalFrame
that will receive the focus when thisJInternalFrame
is selected. If thisJInternalFrame
is currently selected, this method returns the same component as thegetFocusOwner
method. If thisJInternalFrame
is not selected, then the child component that most recently requested focus will be returned. If no child component has ever requested focus, then thisJInternalFrame
's initial focusable component is returned. If no such child exists, then thisJInternalFrame
's default component to focus is returned.
Returns:
the child component that will receive focus when thisJInternalFrame
is selected
Since:
1.4
See Also:
getFocusOwner(), isSelectedrestoreSubcomponentFocus
public void restoreSubcomponentFocus()
Requests the internal frame to restore focus to the last subcomponent that had focus. This is used by the UI when the user selected this internal frame -- for example, by clicking on the title bar.
Since:
1.3reshape
public void reshape(int x, int y, int width, int height)
Moves and resizes this component. Unlike other components, this implementation also forces re-layout, so that frame decorations such as the title bar are always redisplayed.
Overrides:
[reshape](JComponent.html#reshape%28int,int,int,int%29)
in class[JComponent](JComponent.html "class in javax.swing")
Parameters:
x
- an integer giving the component's new horizontal position measured in pixels from the left of its container
y
- an integer giving the component's new vertical position, measured in pixels from the bottom of its container
width
- an integer giving the component's new width in pixels
height
- an integer giving the component's new height in pixels
See Also:
Component.setBounds(int, int, int, int)addInternalFrameListener
Adds the specified listener to receive internal frame events from this internal frame.
Parameters:
l
- the internal frame listenerremoveInternalFrameListener
Removes the specified internal frame listener so that it no longer receives internal frame events from this internal frame.
Parameters:
l
- the internal frame listenergetInternalFrameListeners
Returns an array of all the
InternalFrameListener
s added to thisJInternalFrame
withaddInternalFrameListener
.
Returns:
all of theInternalFrameListener
s added or an empty array if no listeners have been added
Since:
1.4
See Also:
addInternalFrameListener(javax.swing.event.InternalFrameListener)fireInternalFrameEvent
protected void fireInternalFrameEvent(int id)
Fires an internal frame event.
Parameters:
id
- the type of the event being fired; one of the following:
*InternalFrameEvent.INTERNAL_FRAME_OPENED
*InternalFrameEvent.INTERNAL_FRAME_CLOSING
*InternalFrameEvent.INTERNAL_FRAME_CLOSED
*InternalFrameEvent.INTERNAL_FRAME_ICONIFIED
*InternalFrameEvent.INTERNAL_FRAME_DEICONIFIED
*InternalFrameEvent.INTERNAL_FRAME_ACTIVATED
*InternalFrameEvent.INTERNAL_FRAME_DEACTIVATED
If the event type is not one of the above, nothing happens.doDefaultCloseAction
public void doDefaultCloseAction()
Fires anINTERNAL_FRAME_CLOSING
event and then performs the action specified by the internal frame's default close operation. This method is typically invoked by the look-and-feel-implemented action handler for the internal frame's close button.
Since:
1.3
See Also:
setDefaultCloseOperation(int), InternalFrameEvent.INTERNAL_FRAME_CLOSINGsetDefaultCloseOperation
public void setDefaultCloseOperation(int operation)
Sets the operation that will happen by default when the user initiates a "close" on this internal frame. The possible choices are:
DO_NOTHING_ON_CLOSE
Do nothing. This requires the program to handle the operation in theinternalFrameClosing
method of a registeredInternalFrameListener
object.
HIDE_ON_CLOSE
Automatically make the internal frame invisible.
DISPOSE_ON_CLOSE
Automatically dispose of the internal frame.
The default value isDISPOSE_ON_CLOSE
. Before performing the specified close operation, the internal frame fires anINTERNAL_FRAME_CLOSING
event.
Parameters:
operation
- one of the following constants defined injavax.swing.WindowConstants
(an interface implemented byJInternalFrame
):DO_NOTHING_ON_CLOSE
,HIDE_ON_CLOSE
, orDISPOSE_ON_CLOSE
See Also:
addInternalFrameListener(javax.swing.event.InternalFrameListener), getDefaultCloseOperation(), JComponent.setVisible(boolean), dispose(), InternalFrameEvent.INTERNAL_FRAME_CLOSINGgetDefaultCloseOperation
public int getDefaultCloseOperation()
Returns the default operation that occurs when the user initiates a "close" on this internal frame.
Returns:
the operation that will occur when the user closes the internal frame
See Also:
setDefaultCloseOperation(int)pack
public void pack()
Causes subcomponents of thisJInternalFrame
to be laid out at their preferred size. Internal frames that are iconized or maximized are first restored and then packed. If the internal frame is unable to be restored its state is not changed and will not be packed.
See Also:
Window.pack()show
public void show()
If the internal frame is not visible, brings the internal frame to the front, makes it visible, and attempts to select it. The first time the internal frame is made visible, this method also fires anINTERNAL_FRAME_OPENED
event. This method does nothing if the internal frame is already visible. Invoking this method has the same result as invokingsetVisible(true)
.
Overrides:
[show](../../java/awt/Component.html#show%28%29)
in class[Component](../../java/awt/Component.html "class in java.awt")
See Also:
moveToFront(), setSelected(boolean), InternalFrameEvent.INTERNAL_FRAME_OPENED, JComponent.setVisible(boolean)dispose
public void dispose()
Makes this internal frame invisible, unselected, and closed. If the frame is not already closed, this method fires anINTERNAL_FRAME_CLOSED
event. The results of invoking this method are similar tosetClosed(true)
, butdispose
always succeeds in closing the internal frame and does not fire anINTERNAL_FRAME_CLOSING
event.
See Also:
InternalFrameEvent.INTERNAL_FRAME_CLOSED, JComponent.setVisible(boolean), setSelected(boolean), setClosed(boolean)toFront
public void toFront()
Brings this internal frame to the front. Places this internal frame at the top of the stacking order and makes the corresponding adjustment to other visible internal frames.
See Also:
Window.toFront(), moveToFront()toBack
public void toBack()
Sends this internal frame to the back. Places this internal frame at the bottom of the stacking order and makes the corresponding adjustment to other visible internal frames.
See Also:
Window.toBack(), moveToBack()setFocusCycleRoot
public final void setFocusCycleRoot(boolean focusCycleRoot)
Does nothing becauseJInternalFrame
s must always be roots of a focus traversal cycle.
Overrides:
[setFocusCycleRoot](../../java/awt/Container.html#setFocusCycleRoot%28boolean%29)
in class[Container](../../java/awt/Container.html "class in java.awt")
Parameters:
focusCycleRoot
- this value is ignored
Since:
1.4
See Also:
isFocusCycleRoot(), Container.setFocusTraversalPolicy(java.awt.FocusTraversalPolicy), Container.getFocusTraversalPolicy()isFocusCycleRoot
public final boolean isFocusCycleRoot()
Always returnstrue
because allJInternalFrame
s must be roots of a focus traversal cycle.
Overrides:
[isFocusCycleRoot](../../java/awt/Container.html#isFocusCycleRoot%28%29)
in class[Container](../../java/awt/Container.html "class in java.awt")
Returns:
true
Since:
1.4
See Also:
setFocusCycleRoot(boolean), Container.setFocusTraversalPolicy(java.awt.FocusTraversalPolicy), Container.getFocusTraversalPolicy()getFocusCycleRootAncestor
Always returns
null
becauseJInternalFrame
s must always be roots of a focus traversal cycle.
Overrides:
[getFocusCycleRootAncestor](../../java/awt/Component.html#getFocusCycleRootAncestor%28%29)
in class[Component](../../java/awt/Component.html "class in java.awt")
Returns:
null
Since:
1.4
See Also:
Container.isFocusCycleRoot()getWarningString
Gets the warning string that is displayed with this internal frame. Since an internal frame is always secure (since it's fully contained within a window that might need a warning string) this method always returns
null
.
Returns:
null
See Also:
Window.getWarningString()paramString
protected String paramString()
Returns a string representation of thisJInternalFrame
. 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 benull
.
Overrides:
[paramString](JComponent.html#paramString%28%29)
in class[JComponent](JComponent.html "class in javax.swing")
Returns:
a string representation of thisJInternalFrame
paintComponent
protected void paintComponent(Graphics g)
Overridden to allow optimized painting when the internal frame is being dragged.
Overrides:
[paintComponent](JComponent.html#paintComponent%28java.awt.Graphics%29)
in class[JComponent](JComponent.html "class in javax.swing")
Parameters:
g
- theGraphics
object to protect
See Also:
JComponent.paint(java.awt.Graphics), ComponentUIgetAccessibleContext
Gets the
AccessibleContext
associated with thisJInternalFrame
. For internal frames, theAccessibleContext
takes the form of anAccessibleJInternalFrame
object. A newAccessibleJInternalFrame
instance is created if necessary.
Specified by:
[getAccessibleContext](../accessibility/Accessible.html#getAccessibleContext%28%29)
in interface[Accessible](../accessibility/Accessible.html "interface in javax.accessibility")
Overrides:
[getAccessibleContext](../../java/awt/Component.html#getAccessibleContext%28%29)
in class[Component](../../java/awt/Component.html "class in java.awt")
Returns:
anAccessibleJInternalFrame
that serves as theAccessibleContext
of thisJInternalFrame
See Also:
JInternalFrame.AccessibleJInternalFrame