|
|||||||||
| Home >> All >> javax >> [ swing overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
javax.swing
Class JFrame

java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
- All Implemented Interfaces:
- javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, RootPaneContainer, java.io.Serializable, WindowConstants
- public class JFrame
- extends java.awt.Frame
- implements WindowConstants, RootPaneContainer, javax.accessibility.Accessible
- extends java.awt.Frame
A window that supports window decorations (titlebar and borders).
This is an extension of java.awt.Frame that provides support
for the Swing architecture. Most importantly it contains a JRootPane
as it's only top-level child, that manages the content pane, the menu and
a glass pane.
Also, unlike java.awt.Frames, JFrames support the
Swing Pluggable Look & Feel architecture.
| Nested Class Summary | |
protected class |
JFrame.AccessibleJFrame
Provides accessibility support for JFrames. |
| Nested classes inherited from class java.awt.Frame |
java.awt.Frame.AccessibleAWTFrame |
| Nested classes inherited from class java.awt.Window |
java.awt.Window.AccessibleAWTWindow |
| Nested classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
| Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
protected javax.accessibility.AccessibleContext |
accessibleContext
|
private int |
close_action
|
private static boolean |
defaultLookAndFeelDecorated
|
static int |
EXIT_ON_CLOSE
A flag for setDefaultCloseOperation(int) 55 , indicating that the
application should be exited, when this JFrame is closed. |
protected JRootPane |
rootPane
|
protected boolean |
rootPaneCheckingEnabled
|
private static long |
serialVersionUID
|
| Fields inherited from class java.awt.Frame |
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR |
| Fields inherited from class java.awt.Window |
|
| Fields inherited from class java.awt.Container |
|
| Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface javax.swing.WindowConstants |
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE |
| Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
JFrame()
|
|
JFrame(java.awt.GraphicsConfiguration gc)
Creates a new JFrame in the specified java.awt.GraphicsConfiguration and with an empty title. |
|
JFrame(java.lang.String title)
|
|
JFrame(java.lang.String title,
java.awt.GraphicsConfiguration gc)
Creates a new JFrame in the specified java.awt.GraphicsConfiguration and with the specified title. |
|
| Method Summary | |
protected void |
addImpl(java.awt.Component comp,
java.lang.Object constraints,
int index)
This method is called by all the add() methods to perform
the actual adding of the component. |
protected JRootPane |
createRootPane()
|
protected void |
frameInit()
|
javax.accessibility.AccessibleContext |
getAccessibleContext()
If a component supports the Accessibility API then this method should not return null. |
java.awt.Container |
getContentPane()
getContentPane |
int |
getDefaultCloseOperation()
|
java.awt.Component |
getGlassPane()
getGlassPane |
JMenuBar |
getJMenuBar()
|
JLayeredPane |
getLayeredPane()
getLayeredPane |
java.awt.Dimension |
getPreferredSize()
Returns the preferred size of this container. |
JRootPane |
getRootPane()
getRootPane |
static boolean |
isDefaultLookAndFeelDecorated()
|
protected boolean |
isRootPaneCheckingEnabled()
|
protected java.lang.String |
paramString()
Returns a debugging string describing this window. |
protected void |
processKeyEvent(java.awt.event.KeyEvent e)
Called when a key event is dispatched and component events are enabled. |
protected void |
processWindowEvent(java.awt.event.WindowEvent e)
Dispatches this event to any listeners that are listening for WindowEvents on this window. |
void |
remove(java.awt.Component comp)
Removes the specified component from this container. |
void |
setContentPane(java.awt.Container contentPane)
setContentPane |
void |
setDefaultCloseOperation(int operation)
Defines what happens when this frame is closed. |
static void |
setDefaultLookAndFeelDecorated(boolean decorated)
|
void |
setGlassPane(java.awt.Component glassPane)
setGlassPane |
void |
setJMenuBar(JMenuBar menubar)
|
void |
setLayeredPane(JLayeredPane layeredPane)
setLayeredPane |
void |
setLayout(java.awt.LayoutManager manager)
Sets the layout manager for this container to the specified layout manager. |
protected void |
setRootPane(JRootPane root)
|
protected void |
setRootPaneCheckingEnabled(boolean enabled)
|
void |
update(java.awt.Graphics g)
Updates this container. |
| Methods inherited from class java.awt.Frame |
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setIconImage, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.awt.MenuContainer |
getFont, postEvent |
| Field Detail |
EXIT_ON_CLOSE
public static final int EXIT_ON_CLOSE
- A flag for
setDefaultCloseOperation(int)55 , indicating that the application should be exited, when thisJFrameis closed.- Since:
- 1.3
- See Also:
- Constant Field Values
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
defaultLookAndFeelDecorated
private static boolean defaultLookAndFeelDecorated
close_action
private int close_action
accessibleContext
protected javax.accessibility.AccessibleContext accessibleContext
rootPane
protected JRootPane rootPane
rootPaneCheckingEnabled
protected boolean rootPaneCheckingEnabled
| Constructor Detail |
JFrame
public JFrame()
JFrame
public JFrame(java.lang.String title)
JFrame
public JFrame(java.awt.GraphicsConfiguration gc)
- Creates a new JFrame in the specified java.awt.GraphicsConfiguration
and with an empty title.
JFrame
public JFrame(java.lang.String title, java.awt.GraphicsConfiguration gc)
- Creates a new JFrame in the specified java.awt.GraphicsConfiguration
and with the specified title.
| Method Detail |
frameInit
protected void frameInit()
getPreferredSize
public java.awt.Dimension getPreferredSize()
- Description copied from class:
java.awt.Container - Returns the preferred size of this container.
getJMenuBar
public JMenuBar getJMenuBar()
setJMenuBar
public void setJMenuBar(JMenuBar menubar)
setLayout
public void setLayout(java.awt.LayoutManager manager)
- Description copied from class:
java.awt.Container - Sets the layout manager for this container to the specified layout
manager.
setLayeredPane
public void setLayeredPane(JLayeredPane layeredPane)
- Description copied from interface:
RootPaneContainer - setLayeredPane
- Specified by:
setLayeredPanein interfaceRootPaneContainer
getLayeredPane
public JLayeredPane getLayeredPane()
- Description copied from interface:
RootPaneContainer - getLayeredPane
- Specified by:
getLayeredPanein interfaceRootPaneContainer
getRootPane
public JRootPane getRootPane()
- Description copied from interface:
RootPaneContainer - getRootPane
- Specified by:
getRootPanein interfaceRootPaneContainer
setRootPane
protected void setRootPane(JRootPane root)
createRootPane
protected JRootPane createRootPane()
getContentPane
public java.awt.Container getContentPane()
- Description copied from interface:
RootPaneContainer - getContentPane
- Specified by:
getContentPanein interfaceRootPaneContainer
setContentPane
public void setContentPane(java.awt.Container contentPane)
- Description copied from interface:
RootPaneContainer - setContentPane
- Specified by:
setContentPanein interfaceRootPaneContainer
getGlassPane
public java.awt.Component getGlassPane()
- Description copied from interface:
RootPaneContainer - getGlassPane
- Specified by:
getGlassPanein interfaceRootPaneContainer
setGlassPane
public void setGlassPane(java.awt.Component glassPane)
- Description copied from interface:
RootPaneContainer - setGlassPane
- Specified by:
setGlassPanein interfaceRootPaneContainer
addImpl
protected void addImpl(java.awt.Component comp, java.lang.Object constraints, int index)
- Description copied from class:
java.awt.Container - This method is called by all the
add()methods to perform the actual adding of the component. Subclasses who wish to perform their own processing when a component is added should override this method. Any subclass doing this must call the superclass version of this method in order to ensure proper functioning of the container.
remove
public void remove(java.awt.Component comp)
- Description copied from class:
java.awt.Container - Removes the specified component from this container.
isRootPaneCheckingEnabled
protected boolean isRootPaneCheckingEnabled()
setRootPaneCheckingEnabled
protected void setRootPaneCheckingEnabled(boolean enabled)
update
public void update(java.awt.Graphics g)
- Description copied from class:
java.awt.Container - Updates this container. The implementation of this method in this
class forwards to any lightweight components in this container. If
this method is subclassed, this method should still be invoked as
a superclass method so that lightweight components are properly
drawn.
processKeyEvent
protected void processKeyEvent(java.awt.event.KeyEvent e)
- Description copied from class:
java.awt.Component - Called when a key event is dispatched and component events are
enabled. This method passes the event along to any listeners
that are attached.
setDefaultLookAndFeelDecorated
public static void setDefaultLookAndFeelDecorated(boolean decorated)
isDefaultLookAndFeelDecorated
public static boolean isDefaultLookAndFeelDecorated()
getAccessibleContext
public javax.accessibility.AccessibleContext getAccessibleContext()
- Description copied from interface:
javax.accessibility.Accessible - If a component supports the Accessibility API then this method should
not return
null. Only classes which must extend an accessible class, but must not itself be accessible, may return null.- Specified by:
getAccessibleContextin interfacejavax.accessibility.Accessible
getDefaultCloseOperation
public int getDefaultCloseOperation()
paramString
protected java.lang.String paramString()
- Description copied from class:
java.awt.Frame - Returns a debugging string describing this window.
processWindowEvent
protected void processWindowEvent(java.awt.event.WindowEvent e)
- Description copied from class:
java.awt.Window - Dispatches this event to any listeners that are listening for
WindowEventson this window. This method only gets invoked if it is enabled viaenableEvents()or if a listener has been added.
setDefaultCloseOperation
public void setDefaultCloseOperation(int operation)
- Defines what happens when this frame is closed. Can be one off
EXIT_ON_CLOSE,DISPOSE_ON_CLOSE,HIDE_ON_CLOSEorDO_NOTHING_ON_CLOSE. The default isHIDE_ON_CLOSE. WhenEXIT_ON_CLOSEis specified this method callsSecurityManager.checkExit(0)which might throw aSecurityException. When the specified operation is not one of the above aIllegalArgumentExceptionis thrown.
|
|||||||||
| Home >> All >> javax >> [ swing overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC