Overview | Package | Class | Tree | Deprecated | Index | Help |
Java Platform 1.1.7 |
||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--com.sun.java.swing.JComponent | +--com.sun.java.swing.JInternalFrame
The JInternalFrame contentPane
is where you add child components.
So, to create a JInternalFrame that has a number of buttons arranged
with a BorderLayout object, you might do something like this:
JComponent c = frame.getContentPane(); c.setLayoutManager(new BorderLayout()); c.add(new JButton(), BorderLayout.NORTH); c.add(new JButton(), BorderLayout.CENTER);The
contentPane
is actually managed by an instance of JRootPane,
which also manages a layoutPane
, glassPane
, and
optional menuBar
for the frame. Please see the JRootPane
documentation for a complete description of these components.
For the keyboard keys used by this component in the standard Look and Feel (L&F) renditions, see the JInternalFrame key assignments.
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.
Inner Class Summary | |
JInternalFrame.AccessibleJInternalFrame
The class used to obtain the accessible role for this object. |
|
static | JInternalFrame.JDesktopIcon
This component represents an iconified version of a JInternalFrame. |
Inner classes inherited from class com.sun.java.swing.JComponent | |
JComponent.AccessibleJComponent |
Field Summary | |
boolean | closable
The frame can be closed. |
static java.lang.String | CONTENT_PANE_PROPERTY
Bound property name. |
JInternalFrame.JDesktopIcon | desktopIcon
The icon that is displayed when the frame is iconized. |
Icon | frameIcon
The icon shown in the top-left corner of the frame. |
static java.lang.String | GLASS_PANE_PROPERTY
Bound property name. |
boolean | iconable
The frame can "iconized" (shrunk down and displayed as an icon-image). |
static java.lang.String | IS_CLOSED_PROPERTY
Constrained property name indicating that the frame is closed. |
static java.lang.String | IS_ICON_PROPERTY
Constrained property name indicating that the frame is iconified. |
static java.lang.String | IS_MAXIMUM_PROPERTY
Constrained property name indicating that the frame is maximized. |
static java.lang.String | IS_SELECTED_PROPERTY
Constrained property name indicated that this frame has selected status. |
boolean | isClosed
The frame has been closed. |
boolean | isIcon
The frame has been iconized. |
boolean | isMaximum
The frame has been expanded to its maximum size. |
boolean | isSelected
The frame is currently selected. |
static java.lang.String | LAYERED_PANE_PROPERTY
Bound property name. |
boolean | maximizable
The frame can be expanded to the size of the desktop pane. |
static java.lang.String | MENU_BAR_PROPERTY
Bound property name. |
boolean | resizable
The frame's size can be changed. |
static java.lang.String | ROOT_PANE_PROPERTY
Bound property name. |
boolean | rootPaneCheckingEnabled
If true then calls to add and setLayout
cause an exception to be thrown. |
JRootPane | rootPane
The JRootPane instance that manages the contentPane
and optional menuBar for this frame, as well as the
glassPane . |
static java.lang.String | TITLE_PROPERTY
Bound property name. |
java.lang.String | title
The title displayed in the frame's title bar. |
Fields inherited from class com.sun.java.swing.JComponent | |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component | |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Constructor Summary | |
JInternalFrame()
Creates a non-resizable, non-closable, non-maximizable, non-iconifiable JInternalFrame with no title. |
|
JInternalFrame(java.lang.String title)
Creates a non-resizable, non-closable, non-maximizable, non-iconifiable JInternalFrame with the specified title. |
|
JInternalFrame(java.lang.String title,
boolean resizable)
Creates a non-closable, non-maximizable, non-iconifiable JInternalFrame with the specified title and with resizability specified. |
|
JInternalFrame(java.lang.String title,
boolean resizable,
boolean closable)
Creates a non-maximizable, non-iconifiable JInternalFrame with the specified title and with resizability and closability specified. |
|
JInternalFrame(java.lang.String title,
boolean resizable,
boolean closable,
boolean maximizable)
Creates a non-iconifiable JInternalFrame with the specified title and with resizability, closability, and maximizability specified. |
|
JInternalFrame(java.lang.String title,
boolean resizable,
boolean closable,
boolean maximizable,
boolean iconifiable)
Creates a JInternalFrame with the specified title and with resizability, closability, maximizability, and iconifiability specified. |
Method Summary | |
void | addImpl(java.awt.Component comp,
java.lang.Object constraints,
int index)
By default, children may not be added directly to a this component, they must be added to its contentPane instead. |
void | addInternalFrameListener(InternalFrameListener l)
Adds the specified internal frame listener to receive internal frame events from this internal frame. |
void | componentHidden(java.awt.event.ComponentEvent e)
|
void | componentMoved(java.awt.event.ComponentEvent e)
|
void | componentResized(java.awt.event.ComponentEvent e)
Invoked when a maximized JInternalFrame's parent's size changes. |
void | componentShown(java.awt.event.ComponentEvent e)
|
JRootPane | createRootPane()
Called by the constructor to set up the JRootPane. |
void | dispose()
Disposes of this internal frame. |
AccessibleContext | getAccessibleContext()
Get the AccessibleContext associated with this JComponent |
java.awt.Color | getBackground()
Get the background color of this object. |
java.awt.Container | getContentPane()
|
int | getDefaultCloseOperation()
Returns the default operation which occurs when the user initiates a "close" on this window. |
JInternalFrame.JDesktopIcon | getDesktopIcon()
Returns the JDesktopIcon used when this JInternalFrame is iconified. |
JDesktopPane | getDesktopPane()
Convenience method that searchs the anscestor heirarchy for a JDesktop instance. |
java.awt.Color | getForeground()
Get the foreground color of this object. |
Icon | getFrameIcon()
Returns the image displayed in the title bar of the frame (usually in the top-left corner). |
java.awt.Component | getGlassPane()
|
JLayeredPane | getLayeredPane()
|
int | getLayer()
Convenience method for getting the layer attribute of this component. |
JMenuBar | getMenuBar()
Returns the current JMenuBar for this JInternalFrame, or null if no menu bar has been set. |
JRootPane | getRootPane()
|
java.lang.String | getTitle()
Returns the title of the JInternalFrame. |
java.lang.String | getUIClassID()
Returns the name of the L&F class that renders this component. |
com.sun.java.swing.plaf.InternalFrameUI | getUI()
Returns the L&F object that renders this component. |
java.lang.String | getWarningString()
Gets the warning string that is displayed with this window. |
boolean | isClosable()
Returns whether this JInternalFrame be closed by some user action. |
boolean | isClosed()
Returns whether this JInternalFrame is currently closed. |
boolean | isIconifiable()
Returns whether the JInternalFrame can be iconified by some user action. |
boolean | isIcon()
Returns whether the JInternalFrame is currently iconified. |
boolean | isMaximizable()
Returns whether the JInternalFrame can be maximized by some user action. |
boolean | isMaximum()
Returns whether the JInternalFrame is currently maximized. |
boolean | isResizable()
Returns whether the JInternalFrame can be resized by some user action. |
boolean | isRootPaneCheckingEnabled()
Returns whether calls to add and
setLayout cause an exception to be thrown. |
boolean | isSelected()
Returns whether the JInternalFrame is the currently "selected" or active frame. |
void | mouseClicked(java.awt.event.MouseEvent e)
Ignore mouseClicked events. |
void | mouseDragged(java.awt.event.MouseEvent e)
Ignore mouseDragged events. |
void | mouseEntered(java.awt.event.MouseEvent e)
Forward the mouseEntered event to the underlying child container. |
void | mouseExited(java.awt.event.MouseEvent e)
Forward the mouseExited event to the underlying child container. |
void | mouseMoved(java.awt.event.MouseEvent e)
Forward the mouseMoved event to the underlying child container. |
void | mousePressed(java.awt.event.MouseEvent e)
When inactive, mouse events are forwarded as appropriate either to the UI to activate the frame or to the underlying child component. |
void | mouseReleased(java.awt.event.MouseEvent e)
Ignore mouseReleased events. |
void | moveToBack()
Convenience method that moves this component to position -1 if it's parent is a JLayeredPane. |
void | moveToFront()
Convenience method that moves this component to position 0 if it's parent is a JLayeredPane. |
void | pack()
Causes subcomponents of this JInternalFrame to be laid out at their preferred size. |
void | processEvent(java.awt.AWTEvent e)
Processes events on this internal frame. |
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 | setBackground(java.awt.Color c)
Set the background color of this object. |
void | setClosable(boolean b)
Set that this JInternalFrame can be closed by some user action. |
void | setClosed(boolean b)
Calling this method with a value of true to close
the frame. |
void | setContentPane(java.awt.Container c)
Sets this JInternalFrame's content pane. |
void | setDefaultCloseOperation(int operation)
Sets the operation which will happen by default when the user initiates a "close" on this window. |
void | setDesktopIcon(JInternalFrame.JDesktopIcon d)
Sets the JDesktopIcon associated with this JInternalFrame. |
void | setForeground(java.awt.Color c)
Set the foreground color of this object. |
void | setFrameIcon(Icon icon)
Sets an image to be displayed in the titlebar of the frame (usually in the top-left corner). |
void | setGlassPane(java.awt.Component glass)
Sets this JInternalFrame's glass pane. |
void | setIconifiable(boolean b)
Set that the JInternalFrame can be made an icon by some user action. |
void | setIcon(boolean b)
Iconizes and deconizes the frame. |
void | setLayeredPane(JLayeredPane layered)
Sets this JInternalFrame's layered pane. |
void | setLayer(java.lang.Integer layer)
Convenience method for setting the layer attribute of this component. |
void | setLayout(java.awt.LayoutManager manager)
By default the layout of this component may not be set, the layout of its contentPane should be set instead. |
void | setMaximizable(boolean b)
Set that the JInternalFrame can be maximized by some user action. |
void | setMaximum(boolean b)
Maximizes and restores the frame. |
void | setMenuBar(JMenuBar m)
Sets the JMenuBar for this JInternalFrame. |
void | setResizable(boolean b)
Set that the JInternalFrame can be resized by some user action. |
void | setRootPaneCheckingEnabled(boolean enabled)
Determines whether calls to add and
setLayout cause an exception to be thrown. |
void | setRootPane(JRootPane root)
Set the rootPane property. |
void | setSelected(boolean selected)
Selects and deselects the JInternalFrame. |
void | setTitle(java.lang.String title)
Sets the JInternalFrame title. |
void | setUI(com.sun.java.swing.plaf.InternalFrameUI ui)
Sets the UI delegate for this JInternalFrame. |
void | setVisible(boolean b)
Set the visible state of the object. |
void | show()
Shows this internal frame, and brings it to the front. |
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 L&F has changed. |
Methods inherited from class java.awt.Container | |
add, add, add, add, add, addContainerListener, addImpl, addNotify, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponentAt, getComponentAt, getComponent, getComponentCount, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, paint, paramString, preferredSize, printComponents, print, processContainerEvent, processEvent, removeAll, remove, remove, removeContainerListener, removeNotify, setLayout, update, validate, validateTree |
Methods inherited from class java.awt.Component | |
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getName, getParent, getPeer, getPreferredSize, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paint, paramString, postEvent, preferredSize, prepareImage, prepareImage, printAll, print, processComponentEvent, processEvent, processFocusEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, update, validate |
Methods inherited from class java.lang.Object | |
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait |
Field Detail |
protected JRootPane rootPane
contentPane
and optional menuBar
for this frame, as well as the
glassPane
.protected boolean rootPaneCheckingEnabled
add
and setLayout
cause an exception to be thrown.protected boolean closable
protected boolean isClosed
protected boolean maximizable
protected boolean isMaximum
protected boolean iconable
protected boolean isIcon
protected boolean resizable
protected boolean isSelected
protected Icon frameIcon
protected java.lang.String title
protected JInternalFrame.JDesktopIcon desktopIcon
public static final java.lang.String CONTENT_PANE_PROPERTY
public static final java.lang.String MENU_BAR_PROPERTY
public static final java.lang.String TITLE_PROPERTY
public static final java.lang.String LAYERED_PANE_PROPERTY
public static final java.lang.String ROOT_PANE_PROPERTY
public static final java.lang.String GLASS_PANE_PROPERTY
public static final java.lang.String IS_SELECTED_PROPERTY
public static final java.lang.String IS_CLOSED_PROPERTY
public static final java.lang.String IS_MAXIMUM_PROPERTY
public static final java.lang.String IS_ICON_PROPERTY
Constructor Detail |
public JInternalFrame()
public JInternalFrame(java.lang.String title)
title
- the String to display in the title bar.public JInternalFrame(java.lang.String title, boolean resizable)
title
- the String to display in the title bar.
resizable
- if true, the frame can be resizedpublic JInternalFrame(java.lang.String title, boolean resizable, boolean closable)
title
- the String to display in the title bar.
resizable
- if true, the frame can be resized
closable
- if true, the frame can be closedpublic JInternalFrame(java.lang.String title, boolean resizable, boolean closable, boolean maximizable)
title
- the String to display in the title bar.
resizable
- if true, the frame can be resized
closable
- if true, the frame can be closed
maximizable
- if true, the frame can be maximizedpublic JInternalFrame(java.lang.String title, boolean resizable, boolean closable, boolean maximizable, boolean iconifiable)
title
- the String to display in the title bar.
resizable
- if true, the frame can be resized
closable
- if true, the frame can be closed
maximizable
- if true, the frame can be maximized
iconifiable
- if true, the frame can be iconifiedMethod Detail |
protected JRootPane createRootPane()
public com.sun.java.swing.plaf.InternalFrameUI getUI()
public void setUI(com.sun.java.swing.plaf.InternalFrameUI ui)
public void updateUI()
public java.lang.String getUIClassID()
protected boolean isRootPaneCheckingEnabled()
add
and
setLayout
cause an exception to be thrown.add
and setLayout
are checkedprotected void setRootPaneCheckingEnabled(boolean enabled)
add
and
setLayout
cause an exception to be thrown.
enabled
- a boolean value, true if checking is to be
enabled, which cause the exceptions to be thrownprotected void addImpl(java.awt.Component comp, java.lang.Object constraints, int index)
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.
public void setLayout(java.awt.LayoutManager manager)
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.
public JMenuBar getMenuBar()
public void setMenuBar(JMenuBar m)
m
- the JMenuBar to use in this framepublic java.awt.Container getContentPane()
public void setContentPane(java.awt.Container c)
c
- the Container to use for the contents of this JInternalFramepublic JLayeredPane getLayeredPane()
public void setLayeredPane(JLayeredPane layered)
public java.awt.Component getGlassPane()
public void setGlassPane(java.awt.Component glass)
public JRootPane getRootPane()
protected void setRootPane(JRootPane root)
public void setVisible(boolean b)
b
- if true, shows this object; otherwise, hides itpublic void setClosable(boolean b)
b
- a boolean value, where true means the frame can be closedpublic boolean isClosable()
public boolean isClosed()
public void setClosed(boolean b) throws java.beans.PropertyVetoException
true
to close
the frame.
b
- a boolean, where true means "close the frame"public void setResizable(boolean b)
b
- a boolean, where true means the frame can be resizedpublic boolean isResizable()
public void setIconifiable(boolean b)
b
- a boolean, where true means the frame can be iconifiedpublic boolean isIconifiable()
public boolean isIcon()
public void setIcon(boolean b) throws java.beans.PropertyVetoException
b
- a boolean, where true means to iconify the frame and
false means to deiconify itpublic void setMaximizable(boolean b)
b
- a boolean where true means the frame can be maximizedpublic boolean isMaximizable()
public boolean isMaximum()
public void setMaximum(boolean b) throws java.beans.PropertyVetoException
b
- a boolean, where true maximizes the frame and false
restores itpublic java.lang.String getTitle()
public void setTitle(java.lang.String title)
title
- the String to display in the title barpublic void setSelected(boolean selected) throws java.beans.PropertyVetoException
selected
- a boolean, where true means the frame is selected
(currently active) and false means it is notpublic boolean isSelected()
public void setFrameIcon(Icon icon)
desktopIcon
object, which
is the image displayed in the JDesktop when the frame is iconified.
icon
- the Icon to display in the title barpublic Icon getFrameIcon()
public java.awt.Color getBackground()
public void setBackground(java.awt.Color c)
isOpaque
.)
c
- the new Color for the backgroundpublic java.awt.Color getForeground()
public void setForeground(java.awt.Color c)
c
- the new Color for the foregroundpublic void moveToFront()
public void moveToBack()
public void setLayer(java.lang.Integer layer)
layer
- an Integer object specifying this frame's desktop layerpublic int getLayer()
public JDesktopPane getDesktopPane()
public void setDesktopIcon(JInternalFrame.JDesktopIcon d)
d
- the JDesktopIcon to display on the desktoppublic JInternalFrame.JDesktopIcon getDesktopIcon()
public void reshape(int x, int y, int width, int height)
x
- an int giving the component's new horizontal position
measured in pixels from the left of its container
y
- an int giving the component's new vertical position,
measured in pixels from the bottom of its container
width
- an int giving the component's new width in pixels
height
- an int giving the component's new height in pixelspublic void addInternalFrameListener(InternalFrameListener l)
l
- the internal frame listenerpublic void removeInternalFrameListener(InternalFrameListener l)
l
- the internal frame listenerprotected void processEvent(java.awt.AWTEvent e)
e
- the eventpublic void setDefaultCloseOperation(int operation)
The value is set to HIDE_ON_CLOSE by default.
public int getDefaultCloseOperation()
public void pack()
public void show()
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.
public void dispose()
public void toFront()
public void toBack()
public final java.lang.String getWarningString()
public void mousePressed(java.awt.event.MouseEvent e)
public void mouseEntered(java.awt.event.MouseEvent e)
public void mouseMoved(java.awt.event.MouseEvent e)
public void mouseExited(java.awt.event.MouseEvent e)
public void mouseClicked(java.awt.event.MouseEvent e)
public void mouseReleased(java.awt.event.MouseEvent e)
public void mouseDragged(java.awt.event.MouseEvent e)
public void componentResized(java.awt.event.ComponentEvent e)
public void componentMoved(java.awt.event.ComponentEvent e)
public void componentShown(java.awt.event.ComponentEvent e)
public void componentHidden(java.awt.event.ComponentEvent e)
public AccessibleContext getAccessibleContext()
Overview | Package | Class | Tree | Deprecated | Index | Help |
Java Platform 1.1.7 |
||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |