All Packages  Class Hierarchy  This Package  Previous  Next  Index  

Class java.awt.swing.JInternalFrame

java.lang.Object
    |
    +----java.awt.Component
            |
            +----java.awt.Container
                    |
                    +----java.awt.swing.JComponent
                            |
                            +----java.awt.swing.JInternalFrame

public class JInternalFrame
extends JComponent
implements Accessible
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(), "North");
    c.add(new JButton(), "Center");
 

 

Please see the JRootPane documentation for a complete description of the contentPane(), glassPane(), and layeredPane() components.

See Also:
JDesktopPane, JDesktopIcon, DesktopManager, JRootPane

Variable Index

 o closable
 o CONTENT_PANE_PROPERTY
Bound property name.
 o desktopIcon
 o frameIcon
 o GLASS_PANE_PROPERTY
Bound property name.
 o iconable
 o IS_CLOSED_PROPERTY
Constrained property name indicating that the frame is closed.
 o IS_ICON_PROPERTY
Constrained property name indicating that the frame is iconified.
 o IS_MAXIMUM_PROPERTY
Constrained property name indicating that the frame is maximized.
 o IS_SELECTED_PROPERTY
Constrained property name indicated that this frame has selected status.
 o isClosed
 o isIcon
 o isMaximum
 o isSelected
 o LAYERED_PANE_PROPERTY
Bound property name.
 o maximizable
 o MENU_BAR_PROPERTY
Bound property name.
 o opaque
 o resizable
 o ROOT_PANE_PROPERTY
Bound property name.
 o rootPane
 o title
 o TITLE_PROPERTY
Bound property name.

Constructor Index

 o JInternalFrame()
Creates a JInternalFrame with no title, and all boolean setting false.
 o JInternalFrame(String)
Creates a JInternalFrame with title, and all boolean setting false.
 o JInternalFrame(String, boolean)
 o JInternalFrame(String, boolean, boolean)
 o JInternalFrame(String, boolean, boolean, boolean)
 o JInternalFrame(String, boolean, boolean, boolean, boolean)
Primative creation method that sets the appropriate values.

Method Index

 o createRootPane()
 o getAccessibleName()
Get the accessible name of this object.
 o getAccessibleRole()
Get the role of this object.
 o getAccessibleValue()
Get the value of this object as a Number.
 o getContentPane()
The content pane is the child component of the JInternalFrame that normal user components should be placed.
 o getDesktopIcon()
Returns a JDesktopIcon object suitably configured to display this JInternalFrame when iconified.
 o getDesktopPane()
Convience method that searchs the anscestor heirarchy for a JDesktop instance.
 o getFrameIcon()
 o getGlassPane()
 o getLayer()
Convience method for getting the layer attribute of this component.
 o getLayeredPane()
 o getMenuBar()
 o getRootPane()
 o getTitle()
 o getUI()
 o getUIClassID()
 o isClosable()
Can the JInternalFrame be closed by some user action.
 o isClosed()
 o isIcon()
 o isIconifiable()
 o isMaximizable()
 o isMaximum()
 o isOpaque()
Returns true if this component is completely opaque.
 o isResizable()
 o isSelected()
 o moveToBack()
Convience method that moves this component to position -1 if it's parent is a JLayeredPane.
 o moveToFront()
Convience method that moves this component to position 0 if it's parent is a JLayeredPane.
 o setAccessibleValue(Number)
Set the value of this object as a Number.
 o setClosable(boolean)
Set that the JInternalFrame can be closed by some user action.
 o setClosed(boolean)
Calling this method with true, will cause the frame to close.
 o setContentPane(Container)
 o setDesktopIcon(JDesktopIcon)
 o setFrameIcon(Icon)
Sets an image to be displayed in the titlebar of the frame.
 o setGlassPane(Component)
 o setIcon(boolean)
Setting this property to true will iconify the frame, false will deiconify.
 o setIconifiable(boolean)
Set that the JInternalFrame can be made an icon by some user action.
 o setLayer(Integer)
Convience method for setting the layer attribute of this component.
 o setLayeredPane(JLayeredPane)
 o setMaximizable(boolean)
Set that the JInternalFrame can be maximized by some user action.
 o setMaximum(boolean)
Setting this property to true will maximize the frame, false will minimize.
 o setMenuBar(JMenuBar)
 o setOpaque(boolean)
Defines whether or not the frame's background should be painted.
 o setResizable(boolean)
Set that the JInternalFrame resizable by some user action.
 o setRootPane(JRootPane)
 o setSelected(boolean)
A JInternalFrame normally draws it's title bar differently if it is the selected frame.
 o setTitle(String)
Sets the JInternalFrame title.
 o setUI(InternalFrameUI)
 o startModal()
Creates a new EventDispatchThread to dispatch events from.
 o stopModal()
Stops the event dispatching loop created in a previous call to start.
 o updateUI()
Called to replace the UI with the latest version from the default UIFactory.

Variables

 o rootPane
protected JRootPane rootPane
 o closable
protected boolean closable
 o isClosed
protected boolean isClosed
 o maximizable
protected boolean maximizable
 o isMaximum
protected boolean isMaximum
 o iconable
protected boolean iconable
 o isIcon
protected boolean isIcon
 o resizable
protected boolean resizable
 o isSelected
protected boolean isSelected
 o opaque
protected boolean opaque
 o frameIcon
protected Icon frameIcon
 o title
protected String title
 o desktopIcon
protected JDesktopIcon desktopIcon
 o CONTENT_PANE_PROPERTY
public static final String CONTENT_PANE_PROPERTY
Bound property name.

 o MENU_BAR_PROPERTY
public static final String MENU_BAR_PROPERTY
Bound property name.

 o TITLE_PROPERTY
public static final String TITLE_PROPERTY
Bound property name.

 o LAYERED_PANE_PROPERTY
public static final String LAYERED_PANE_PROPERTY
Bound property name.

 o ROOT_PANE_PROPERTY
public static final String ROOT_PANE_PROPERTY
Bound property name.

 o GLASS_PANE_PROPERTY
public static final String GLASS_PANE_PROPERTY
Bound property name.

 o IS_SELECTED_PROPERTY
public static final String IS_SELECTED_PROPERTY
Constrained property name indicated that this frame has selected status.

 o IS_CLOSED_PROPERTY
public static final String IS_CLOSED_PROPERTY
Constrained property name indicating that the frame is closed.

 o IS_MAXIMUM_PROPERTY
public static final String IS_MAXIMUM_PROPERTY
Constrained property name indicating that the frame is maximized.

 o IS_ICON_PROPERTY
public static final String IS_ICON_PROPERTY
Constrained property name indicating that the frame is iconified.

Constructors

 o JInternalFrame
public JInternalFrame()
Creates a JInternalFrame with no title, and all boolean setting false.

 o JInternalFrame
public JInternalFrame(String title)
Creates a JInternalFrame with title, and all boolean setting false.

 o JInternalFrame
public JInternalFrame(String title,
                      boolean resizable)
 o JInternalFrame
public JInternalFrame(String title,
                      boolean resizable,
                      boolean closable)
 o JInternalFrame
public JInternalFrame(String title,
                      boolean resizable,
                      boolean closable,
                      boolean maximizable)
 o JInternalFrame
public JInternalFrame(String title,
                      boolean resizable,
                      boolean closable,
                      boolean maximizable,
                      boolean iconifiable)
Primative creation method that sets the appropriate values.

Methods

 o createRootPane
protected JRootPane createRootPane()
 o getUI
public InternalFrameUI getUI()
 o setUI
public void setUI(InternalFrameUI ui)
 o updateUI
public void updateUI()
Called to replace the UI with the latest version from the default UIFactory.

Overrides:
updateUI in class JComponent
 o getUIClassID
public String getUIClassID()
Returns:
"InternalFrameUI"
Overrides:
getUIClassID in class JComponent
See Also:
getUIClassID, getUI
 o getContentPane
public Container getContentPane()
The content pane is the child component of the JInternalFrame that normal user components should be placed. If you want to add components to the JInternalFrame, you should normally add them to this component, instead of the JInternalFrame itself.

 o setContentPane
public void setContentPane(Container c)
 o getMenuBar
public JMenuBar getMenuBar()
 o setMenuBar
public void setMenuBar(JMenuBar m)
 o setLayeredPane
public void setLayeredPane(JLayeredPane layered)
 o getLayeredPane
public JLayeredPane getLayeredPane()
 o setGlassPane
public void setGlassPane(Component glass)
 o getGlassPane
public Component getGlassPane()
 o setRootPane
protected void setRootPane(JRootPane root)
 o getRootPane
public JRootPane getRootPane()
 o setClosable
public void setClosable(boolean b)
Set that the JInternalFrame can be closed by some user action.

 o isClosable
public boolean isClosable()
Can the JInternalFrame be closed by some user action.

 o isClosed
public boolean isClosed()
 o 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.
 o setResizable
public void setResizable(boolean b)
Set that the JInternalFrame resizable by some user action.

 o isResizable
public boolean isResizable()
 o setIconifiable
public void setIconifiable(boolean b)
Set that the JInternalFrame can be made an icon by some user action.

 o isIconifiable
public boolean isIconifiable()
 o isIcon
public boolean isIcon()
 o 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.
 o setMaximizable
public void setMaximizable(boolean b)
Set that the JInternalFrame can be maximized by some user action.

 o isMaximizable
public boolean isMaximizable()
 o isMaximum
public boolean isMaximum()
 o 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.
 o getTitle
public String getTitle()
 o setTitle
public void setTitle(String title)
Sets the JInternalFrame title.

 o 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 window has focus for the user.

Throws: PropertyVetoException
when the attempt to set the property is vetoed by the receiver.
 o isSelected
public boolean isSelected()
 o 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.

 o getFrameIcon
public Icon getFrameIcon()
 o moveToFront
public void moveToFront()
Convience method that moves this component to position 0 if it's parent is a JLayeredPane.

 o moveToBack
public void moveToBack()
Convience method that moves this component to position -1 if it's parent is a JLayeredPane.

 o setLayer
public void setLayer(Integer layer)
Convience method for setting the layer attribute of this component.

 o getLayer
public int getLayer()
Convience method for getting the layer attribute of this component.

 o getDesktopPane
public JDesktopPane getDesktopPane()
Convience method that searchs the anscestor heirarchy for a JDesktop instance. If JInternalFrame finds none, the desktopIcon tree is searched.

 o setDesktopIcon
public void setDesktopIcon(JDesktopIcon d)
 o getDesktopIcon
public JDesktopIcon getDesktopIcon()
Returns a JDesktopIcon object suitably configured to display this JInternalFrame when iconified.

 o isOpaque
public boolean isOpaque()
Returns true if this component is completely opaque.

Overrides:
isOpaque in class JComponent
 o setOpaque
public void setOpaque(boolean opaque)
Defines whether or not the frame's background should be painted. Setting this to false results in the frame being transparent. Set to true by default.

Parameters:
opaque - whether or not the background should be painted
See Also:
isOpaque
 o startModal
public void startModal()
Creates a new EventDispatchThread to dispatch events from. This method will return when stopModal is invoked.

 o stopModal
public void stopModal()
Stops the event dispatching loop created in a previous call to start.

 o getAccessibleName
public String getAccessibleName()
Get the accessible name of this object. This should almost never return java.awt.Component.getName(), as that generally isn't a localized name, and doesn't have meaning for the user. If the object is fundamentally a text object (e.g. a menu item), the accessible name should be the text of the object (e.g. "save"). If the object has a tooltip, the tooltip text may also be an appropriate String to return.

Returns:
the localized name of the object -- can be null if this object does not have a name
Overrides:
getAccessibleName in class JComponent
See Also:
setAccessibleName
 o getAccessibleRole
public AccessibleRole getAccessibleRole()
Get the role of this object.

Returns:
an instance of AccessibleRole describing the role of the object
Overrides:
getAccessibleRole in class JComponent
See Also:
AccessibleRole
 o getAccessibleValue
public Number getAccessibleValue()
Get the value of this object as a Number.

Returns:
value of the object -- can be null if this object does not have a value
Overrides:
getAccessibleValue in class JComponent
 o setAccessibleValue
public boolean setAccessibleValue(Number n)
Set the value of this object as a Number.

Returns:
True if the value was set.
Overrides:
setAccessibleValue in class JComponent

All Packages  Class Hierarchy  This Package  Previous  Next  Index  

Submit a bug or feature