All Packages Class Hierarchy This Package Previous Next Index
Class com.sun.java.swing.JInternalFrame
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----com.sun.java.swing.JComponent
|
+----com.sun.java.swing.JInternalFrame
- public class JInternalFrame
- extends JComponent
- implements Accessible, MouseListener, MouseMotionListener, WindowConstants, RootPaneContainer, ComponentListener
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. Generally,
you will create an instance and add it to a JDesktopPane.
The JInternalFrame has a 'contentPane' that is used to describe the
area of the component where normal child components should be placed.
So, if you wanted build a JInternalFrame that had a number of buttons
arranged through a BorderLayout object, you might do something like:
JComponent c = frame.getContentPane();
c.setLayoutManager(new BorderLayout());
c.add(new JButton(), BorderLayout.NORTH);
c.add(new JButton(), BorderLayout.CENTER);
Please see the JRootPane documentation for a complete description of
the contentPane(), glassPane(), and layeredPane() components.
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 Swing1.0 applications. It will
not be possible to load serialized Swing1.0 objects with future releases
of Swing. The JDK1.2 release of Swing will be the compatibility
baseline for the serialized form of Swing objects.
- See Also:
- JDesktopPane, JInternalFrame. JDesktopIcon, DesktopManager, JRootPane
-
closable
-
-
CONTENT_PANE_PROPERTY
- Bound property name.
-
desktopIcon
-
-
frameIcon
-
-
GLASS_PANE_PROPERTY
- Bound property name.
-
iconable
-
-
IS_CLOSED_PROPERTY
- Constrained property name indicating that the frame is closed.
-
IS_ICON_PROPERTY
- Constrained property name indicating that the frame is iconified.
-
IS_MAXIMUM_PROPERTY
- Constrained property name indicating that the frame is maximized.
-
IS_SELECTED_PROPERTY
- Constrained property name indicated that this frame has selected status.
-
isClosed
-
-
isIcon
-
-
isMaximum
-
-
isSelected
-
-
LAYERED_PANE_PROPERTY
- Bound property name.
-
maximizable
-
-
MENU_BAR_PROPERTY
- Bound property name.
-
resizable
-
-
ROOT_PANE_PROPERTY
- Bound property name.
-
rootPane
-
-
rootPaneCheckingEnabled
-
-
title
-
-
TITLE_PROPERTY
- Bound property name.
-
JInternalFrame()
- Creates a JInternalFrame with no title, and all boolean setting false.
-
JInternalFrame(String)
- Creates a JInternalFrame with title, and all boolean setting false.
-
JInternalFrame(String, boolean)
-
-
JInternalFrame(String, boolean, boolean)
-
-
JInternalFrame(String, boolean, boolean, boolean)
-
-
JInternalFrame(String, boolean, boolean, boolean, boolean)
- Primitive creation method that sets the appropriate values.
-
addImpl(Component, Object, int)
- By default, children may not be added directly to a this component,
they must be added to its contentPane instead.
-
addInternalFrameListener(InternalFrameListener)
- Adds the specified internal frame listener to receive internal frame events from
this internal frame.
-
componentHidden(ComponentEvent)
-
-
componentMoved(ComponentEvent)
-
-
componentResized(ComponentEvent)
- Invoked when a maximized JInternalFrame's parent's size changes.
-
componentShown(ComponentEvent)
-
-
createRootPane()
-
-
dispose()
- Disposes of this internal frame.
-
getAccessibleContext()
- Get the AccessibleContext associated with this JComponent
-
getBackground()
- Get the background color of this object.
-
getContentPane()
-
-
getDefaultCloseOperation()
- Returns the default operation which occurs when the user
initiates a "close" on this window.
-
getDesktopIcon()
-
Returns the JDesktopIcon used when this JInternalFrame is iconified.
-
getDesktopPane()
- Convenience method that searchs the anscestor heirarchy for a JDesktop
instance.
-
getForeground()
- Get the foreground color of this object.
-
getFrameIcon()
-
-
getGlassPane()
-
-
getLayer()
- Convenience method for getting the layer attribute of this component.
-
getLayeredPane()
-
-
getMenuBar()
- Returns the current JMenuBar for this JInternalFrame, or null
if no menu bar has been set.
-
getRootPane()
-
-
getTitle()
- Returns the current JInternalFrame title.
-
getUI()
-
-
getUIClassID()
-
-
getWarningString()
- Gets the warning string that is displayed with this window.
-
isClosable()
-
Returns whether this JInternalFrame be closed by some user action.
-
isClosed()
-
-
isIcon()
-
-
isIconifiable()
-
-
isMaximizable()
-
-
isMaximum()
-
-
isResizable()
-
-
isRootPaneCheckingEnabled()
-
-
isSelected()
-
-
mouseClicked(MouseEvent)
-
-
mouseDragged(MouseEvent)
-
-
mouseEntered(MouseEvent)
-
-
mouseExited(MouseEvent)
-
-
mouseMoved(MouseEvent)
-
-
mousePressed(MouseEvent)
-
-
mouseReleased(MouseEvent)
-
-
moveToBack()
- Convenience method that moves this component to position -1 if it's
parent is a JLayeredPane.
-
moveToFront()
- Convenience method that moves this component to position 0 if it's
parent is a JLayeredPane.
-
pack()
- Causes subcomponents of this JInternalFrame to be laid out at their
preferred size.
-
processEvent(AWTEvent)
- Processes events on this internal frame.
-
removeInternalFrameListener(InternalFrameListener)
- Removes the specified internal frame listener so that it no longer
receives internal frame events from this internal frame.
-
reshape(int, int, int, int)
- Moves and resizes this component.
-
setBackground(Color)
- Set the background color of this object.
-
setClosable(boolean)
-
Set that this JInternalFrame can be closed by some user action.
-
setClosed(boolean)
- Calling this method with true, will cause the frame to close.
-
setContentPane(Container)
- Sets this JInternalFrame's content pane.
-
setDefaultCloseOperation(int)
- Sets the operation which will happen by default when
the user initiates a "close" on this window.
-
setDesktopIcon(JInternalFrame. JDesktopIcon)
- Sets the JDesktopIcon associated with this JInternalFrame.
-
setForeground(Color)
- Set the foreground color of this object.
-
setFrameIcon(Icon)
-
Sets an image to be displayed in the titlebar of the frame.
-
setGlassPane(Component)
-
-
setIcon(boolean)
-
Setting this property to true will iconify the frame, false will
deiconify.
-
setIconifiable(boolean)
-
Set that the JInternalFrame can be made an icon by some user action.
-
setLayer(Integer)
-
Convenience method for setting the layer attribute of this component.
-
setLayeredPane(JLayeredPane)
-
-
setLayout(LayoutManager)
- By default the layout of this component may not be set,
the layout of its contentPane should be set instead.
-
setMaximizable(boolean)
-
Set that the JInternalFrame can be maximized by some user action.
-
setMaximum(boolean)
- Setting this property to true will maximize the frame,
false will minimize.
-
setMenuBar(JMenuBar)
- Sets the JMenuBar for this JInternalFrame.
-
setResizable(boolean)
-
Set that the JInternalFrame resizable by some user action.
-
setRootPane(JRootPane)
- Set the rootPane property.
-
setRootPaneCheckingEnabled(boolean)
- If true then calls to add() and setLayout() will cause an exception
to be thrown.
-
setSelected(boolean)
- A JInternalFrame normally draws it's title bar differently if it is the
selected frame.
-
setTitle(String)
-
Sets the JInternalFrame title.
-
setUI(InternalFrameUI)
- Sets the UI delegate for this JInternalFrame.
-
setVisible(boolean)
- Set the visible state of the object.
-
show()
- Shows this internal frame, and brings it to the front.
-
toBack()
- Sends this internal frame to the back.
-
toFront()
- Brings this internal frame to the front.
-
updateUI()
- Resets the UI property to a value from the current look and feel.
rootPane
protected JRootPane rootPane
- See Also:
- getRootPane, setRootPane
rootPaneCheckingEnabled
protected boolean rootPaneCheckingEnabled
- See Also:
- isRootPaneCheckingEnabled, setRootPaneCheckingEnabled
closable
protected boolean closable
isClosed
protected boolean isClosed
maximizable
protected boolean maximizable
isMaximum
protected boolean isMaximum
iconable
protected boolean iconable
isIcon
protected boolean isIcon
resizable
protected boolean resizable
isSelected
protected boolean isSelected
frameIcon
protected Icon frameIcon
title
protected String title
desktopIcon
protected JInternalFrame. JDesktopIcon desktopIcon
CONTENT_PANE_PROPERTY
public static final String CONTENT_PANE_PROPERTY
- Bound property name.
MENU_BAR_PROPERTY
public static final String MENU_BAR_PROPERTY
- Bound property name.
TITLE_PROPERTY
public static final String TITLE_PROPERTY
- Bound property name.
LAYERED_PANE_PROPERTY
public static final String LAYERED_PANE_PROPERTY
- Bound property name.
ROOT_PANE_PROPERTY
public static final String ROOT_PANE_PROPERTY
- Bound property name.
GLASS_PANE_PROPERTY
public static final String GLASS_PANE_PROPERTY
- Bound property name.
IS_SELECTED_PROPERTY
public static final String IS_SELECTED_PROPERTY
- Constrained property name indicated that this frame has selected status.
IS_CLOSED_PROPERTY
public static final String IS_CLOSED_PROPERTY
- Constrained property name indicating that the frame is closed.
IS_MAXIMUM_PROPERTY
public static final String IS_MAXIMUM_PROPERTY
- Constrained property name indicating that the frame is maximized.
IS_ICON_PROPERTY
public static final String IS_ICON_PROPERTY
- Constrained property name indicating that the frame is iconified.
JInternalFrame
public JInternalFrame()
- Creates a JInternalFrame with no title, and all boolean setting false.
JInternalFrame
public JInternalFrame(String title)
- Creates a JInternalFrame with title, and all boolean setting false.
JInternalFrame
public JInternalFrame(String title,
boolean resizable)
JInternalFrame
public JInternalFrame(String title,
boolean resizable,
boolean closable)
JInternalFrame
public JInternalFrame(String title,
boolean resizable,
boolean closable,
boolean maximizable)
JInternalFrame
public JInternalFrame(String title,
boolean resizable,
boolean closable,
boolean maximizable,
boolean iconifiable)
- Primitive creation method that sets the appropriate values.
createRootPane
protected JRootPane createRootPane()
getUI
public InternalFrameUI getUI()
setUI
public void setUI(InternalFrameUI ui)
- Sets the UI delegate for this JInternalFrame.
updateUI
public void updateUI()
- Resets the UI property to a value from the current look and feel.
- Overrides:
- updateUI in class JComponent
getUIClassID
public String getUIClassID()
- Returns:
- "InternalFrameUI"
- Overrides:
- getUIClassID in class JComponent
- See Also:
- getUIClassID, getUI
isRootPaneCheckingEnabled
protected boolean isRootPaneCheckingEnabled()
- Returns:
- true if add and setLayout should be checked
- See Also:
- addImpl, setLayout, setRootPaneCheckingEnabled
setRootPaneCheckingEnabled
protected void setRootPaneCheckingEnabled(boolean enabled)
- If true then calls to add() and setLayout() will cause an exception
to be thrown.
- See Also:
- addImpl, setLayout, isRootPaneCheckingEnabled
addImpl
protected void addImpl(Component comp,
Object constraints,
int index)
- By default, children may not be added directly to a this component,
they must be added to its contentPane instead. For example:
thisComponent.getContentPane().add(child)
An attempt to add to directly to this component will cause an
runtime exception to be thrown. Subclasses can disable this
behavior.
- Throws: Error
- if called with rootPaneChecking true
- Overrides:
- addImpl in class Container
- See Also:
- setRootPaneCheckingEnabled
setLayout
public void setLayout(LayoutManager manager)
- By default the layout of this component may not be set,
the layout of its contentPane should be set instead.
For example:
thiComponent.getContentPane().setLayout(new BorderLayout())
An attempt to set the layout of this component will cause an
runtime exception to be thrown. Subclasses can disable this
behavior.
- Throws: Error
- if called with rootPaneChecking true
- Overrides:
- setLayout in class Container
- See Also:
- setRootPaneCheckingEnabled
getMenuBar
public JMenuBar getMenuBar()
- Returns the current JMenuBar for this JInternalFrame, or null
if no menu bar has been set.
- See Also:
- setMenuBar
setMenuBar
public void setMenuBar(JMenuBar m)
- Sets the JMenuBar for this JInternalFrame.
- See Also:
- getMenuBar
getContentPane
public Container getContentPane()
- See Also:
- getContentPane
setContentPane
public void setContentPane(Container c)
- Sets this JInternalFrame's content pane.
- See Also:
- getContentPane
getLayeredPane
public JLayeredPane getLayeredPane()
- See Also:
- setLayeredPane
setLayeredPane
public void setLayeredPane(JLayeredPane layered)
- See Also:
- setLayeredPane
getGlassPane
public Component getGlassPane()
- See Also:
- setGlassPane
setGlassPane
public void setGlassPane(Component glass)
- See Also:
- getGlassPane
getRootPane
public JRootPane getRootPane()
- Overrides:
- getRootPane in class JComponent
- See Also:
- getRootPane
setRootPane
protected void setRootPane(JRootPane root)
- Set the rootPane property. This method is called by the constructor.
setVisible
public void setVisible(boolean b)
- Set the visible state of the object.
- Parameters:
- b - if true, shows this object; otherwise, hides it
- Overrides:
- setVisible in class JComponent
setClosable
public void setClosable(boolean b)
- Set that this JInternalFrame can be closed by some user action.
isClosable
public boolean isClosable()
- Returns whether this JInternalFrame be closed by some user action.
isClosed
public boolean isClosed()
setClosed
public void setClosed(boolean b) throws PropertyVetoException
- Calling this method with true, will cause the frame to close.
- Throws: PropertyVetoException
- when the attempt to set the
property is vetoed by the receiver.
setResizable
public void setResizable(boolean b)
- Set that the JInternalFrame resizable by some user action.
isResizable
public boolean isResizable()
setIconifiable
public void setIconifiable(boolean b)
- Set that the JInternalFrame can be made an icon by some user action.
isIconifiable
public boolean isIconifiable()
isIcon
public boolean isIcon()
setIcon
public void setIcon(boolean b) throws PropertyVetoException
- Setting this property to true will iconify the frame, false will
deiconify.
- Throws: PropertyVetoException
- when the attempt to set the
property is vetoed by the receiver.
setMaximizable
public void setMaximizable(boolean b)
- Set that the JInternalFrame can be maximized by some user action.
isMaximizable
public boolean isMaximizable()
isMaximum
public boolean isMaximum()
setMaximum
public void setMaximum(boolean b) throws PropertyVetoException
- Setting this property to true will maximize the frame,
false will minimize.
- Throws: PropertyVetoException
- when the attempt to set the
property is vetoed by the receiver.
getTitle
public String getTitle()
- Returns the current JInternalFrame title.
- See Also:
- setTitle
setTitle
public void setTitle(String title)
- Sets the JInternalFrame title.
- See Also:
- getTitle
setSelected
public void setSelected(boolean selected) throws PropertyVetoException
- A JInternalFrame normally draws it's title bar differently if it is the
selected frame. This normally indicates that this internalFrame has
focus for the user.
- Throws: PropertyVetoException
- when the attempt to set the
property is vetoed by the receiver.
isSelected
public boolean isSelected()
setFrameIcon
public void setFrameIcon(Icon icon)
- Sets an image to be displayed in the titlebar of the frame.
Do not confuse this with the desktopIcon object, which describes
what is displayed in the JDesktop when the frame is iconified.
getFrameIcon
public Icon getFrameIcon()
getBackground
public Color getBackground()
- Get the background color of this object.
- Returns:
- the background color, if supported, of the object;
otherwise, null
- Overrides:
- getBackground in class Component
setBackground
public void setBackground(Color c)
- Set the background color of this object.
(For transparency, see
isOpaque
.)
- Parameters:
- c - the new Color for the background
- Overrides:
- setBackground in class Component
- See Also:
- isOpaque
getForeground
public Color getForeground()
- Get the foreground color of this object.
- Returns:
- the foreground color, if supported, of the object;
otherwise, null
- Overrides:
- getForeground in class Component
setForeground
public void setForeground(Color c)
- Set the foreground color of this object.
- Parameters:
- c - the new Color for the foreground
- Overrides:
- setForeground in class Component
moveToFront
public void moveToFront()
- Convenience method that moves this component to position 0 if it's
parent is a JLayeredPane.
moveToBack
public void moveToBack()
- Convenience method that moves this component to position -1 if it's
parent is a JLayeredPane.
setLayer
public void setLayer(Integer layer)
- Convenience method for setting the layer attribute of this component.
getLayer
public int getLayer()
- Convenience method for getting the layer attribute of this component.
getDesktopPane
public JDesktopPane getDesktopPane()
- Convenience method that searchs the anscestor heirarchy for a JDesktop
instance. If JInternalFrame finds none, the desktopIcon tree is
searched.
setDesktopIcon
public void setDesktopIcon(JInternalFrame. JDesktopIcon d)
- Sets the JDesktopIcon associated with this JInternalFrame.
- See Also:
- getDesktopIcon
getDesktopIcon
public JInternalFrame. JDesktopIcon getDesktopIcon()
- Returns the JDesktopIcon used when this JInternalFrame is iconified.
- See Also:
- setDesktopIcon
reshape
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 in class JComponent
addInternalFrameListener
public synchronized void addInternalFrameListener(InternalFrameListener l)
- Adds the specified internal frame listener to receive internal frame events from
this internal frame.
- Parameters:
- l - the internal frame listener
removeInternalFrameListener
public synchronized void removeInternalFrameListener(InternalFrameListener l)
- Removes the specified internal frame listener so that it no longer
receives internal frame events from this internal frame.
- Parameters:
- l - the internal frame listener
processEvent
protected void processEvent(AWTEvent e)
- Processes events on this internal frame. If the event has a
InternalFrameEvent id, it notifies its internalFrameListener, else it
invokes its superclass's processEvent.
- Parameters:
- e - the event
- Overrides:
- processEvent in class Container
setDefaultCloseOperation
public void setDefaultCloseOperation(int operation)
- Sets the operation which will happen by default when
the user initiates a "close" on this window.
The possible choices are:
- DO_NOTHING_ON_CLOSE - do not do anything - require the
program to handle the operation in the windowClosing
method of a registered InternalFrameListener object.
- HIDE_ON_CLOSE - automatically hide the window after
invoking any registered InternalFrameListener objects
- DISPOSE_ON_CLOSE - automatically hide and dispose the
window after invoking any registered InternalFrameListener objects
The value is set to HIDE_ON_CLOSE by default.
- See Also:
- addInternalFrameListener, getDefaultCloseOperation
getDefaultCloseOperation
public int getDefaultCloseOperation()
- Returns the default operation which occurs when the user
initiates a "close" on this window.
- See Also:
- setDefaultCloseOperation
pack
public void pack()
- Causes subcomponents of this JInternalFrame to be laid out at their
preferred size.
- See Also:
- pack
show
public void show()
- Shows this internal frame, and brings it to the front.
If this window is not yet visible, show
makes it visible. If this window is already visible,
then this method brings it to the front.
- Overrides:
- show in class Component
- See Also:
- show, toFront, setVisible
dispose
public void dispose()
- Disposes of this internal frame.
toFront
public void toFront()
- Brings this internal frame to the front.
- See Also:
- 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 windows.
- See Also:
- toBack, moveToBack
getWarningString
public final String getWarningString()
- Gets the warning string that is displayed with this window.
Since an internal frame is always secure (since it's fully
contained within a window which might need a warning string)
this method always returns null.
- Returns:
- null.
- See Also:
- getWarningString
mousePressed
public void mousePressed(MouseEvent e)
mouseEntered
public void mouseEntered(MouseEvent e)
mouseMoved
public void mouseMoved(MouseEvent e)
mouseExited
public void mouseExited(MouseEvent e)
mouseClicked
public void mouseClicked(MouseEvent e)
mouseReleased
public void mouseReleased(MouseEvent e)
mouseDragged
public void mouseDragged(MouseEvent e)
componentResized
public void componentResized(ComponentEvent e)
- Invoked when a maximized JInternalFrame's parent's size changes.
componentMoved
public void componentMoved(ComponentEvent e)
componentShown
public void componentShown(ComponentEvent e)
componentHidden
public void componentHidden(ComponentEvent e)
getAccessibleContext
public AccessibleContext getAccessibleContext()
- Get the AccessibleContext associated with this JComponent
- Returns:
- the AccessibleContext of this JComponent
- Overrides:
- getAccessibleContext in class JComponent
All Packages Class Hierarchy This Package Previous Next Index