public class JDialog extends Dialog implements Accessible, WindowConstants, RootPaneContainer
Dialog
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.Dialog
s, JDialogs support the
Swing Pluggable Look & Feel architecture.Modifier and Type | Class and Description |
---|---|
protected class |
JDialog.AccessibleJDialog
Provides accessibility support for
JDialog s. |
Dialog.AccessibleAWTDialog, Dialog.ModalExclusionType, Dialog.ModalityType
Window.AccessibleAWTWindow
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
protected AccessibleContext |
accessibleContext
DOCUMENT ME!
|
protected JRootPane |
rootPane
The single RootPane in the Dialog.
|
protected boolean |
rootPaneCheckingEnabled
Whether checking is enabled on the RootPane.
|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
JDialog() |
JDialog(Dialog owner)
Creates a new non-modal JDialog with no title
using the given owner.
|
JDialog(Dialog owner,
boolean modal)
Creates a new JDialog with no title using the
given modal setting and owner.
|
JDialog(Dialog owner,
String title)
Creates a new non-modal JDialog using the
given title and owner.
|
JDialog(Dialog owner,
String title,
boolean modal)
Creates a new JDialog using the given modal
settings, title, and owner.
|
JDialog(Dialog owner,
String title,
boolean modal,
GraphicsConfiguration gc)
Creates a new JDialog using the given modal
settings, title, owner and graphics configuration.
|
JDialog(Frame owner)
Creates a new non-modal JDialog with no title
using the given owner.
|
JDialog(Frame owner,
boolean modal)
Creates a new JDialog with no title using the
given modal setting and owner.
|
JDialog(Frame owner,
String title)
Creates a new non-modal JDialog using the
given title and owner.
|
JDialog(Frame owner,
String title,
boolean modal)
Creates a new JDialog using the given modal
settings, title, and owner.
|
JDialog(Frame owner,
String title,
boolean modal,
GraphicsConfiguration gc)
Creates a new JDialog using the given modal
settings, title, owner and graphics configuration.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addImpl(Component comp,
Object constraints,
int index)
This method is called when a component is added to the
the JDialog.
|
protected JRootPane |
createRootPane()
This method creates a new JRootPane.
|
protected void |
dialogInit()
This method is called to initialize the
JDialog.
|
AccessibleContext |
getAccessibleContext()
DOCUMENT ME!
|
Container |
getContentPane()
This method returns the ContentPane
in the JRootPane.
|
int |
getDefaultCloseOperation()
This method returns the action taken when
the JDialog is closed.
|
Component |
getGlassPane()
This method returns the GlassPane for this JDialog.
|
JMenuBar |
getJMenuBar()
This method returns the JMenuBar used
in this JDialog.
|
JLayeredPane |
getLayeredPane()
This method returns the JLayeredPane used with this JDialog.
|
Dimension |
getPreferredSize()
This method returns the preferred size of
the JDialog.
|
JRootPane |
getRootPane()
This method returns the JRootPane used with this JDialog.
|
static boolean |
isDefaultLookAndFeelDecorated()
This method returns whether JDialogs will have their
window decorations provided by the Look and Feel.
|
protected boolean |
isRootPaneCheckingEnabled()
This method returns whether rootPane checking is enabled.
|
protected String |
paramString()
This method returns a String describing the JDialog.
|
protected void |
processWindowEvent(WindowEvent e)
This method handles window events.
|
void |
remove(Component comp)
This method removes a component from the JDialog.
|
void |
setContentPane(Container contentPane)
This method sets the ContentPane to use with this
JDialog.
|
void |
setDefaultCloseOperation(int operation)
This method sets the action to take
when the JDialog is closed.
|
static void |
setDefaultLookAndFeelDecorated(boolean defaultLookAndFeelDecorated)
This method sets whether JDialogs will have their
window decorations provided by the Look and Feel.
|
void |
setGlassPane(Component glassPane)
This method sets the GlassPane for this JDialog.
|
void |
setJMenuBar(JMenuBar menubar)
This method sets the JMenuBar used
in this JDialog.
|
void |
setLayeredPane(JLayeredPane layeredPane)
This method sets the JLayeredPane used in the JDialog.
|
void |
setLayout(LayoutManager manager)
This method sets the LayoutManager used in the JDialog.
|
protected void |
setRootPane(JRootPane root)
This method sets the JRootPane used with this JDialog.
|
protected void |
setRootPaneCheckingEnabled(boolean enabled)
This method sets whether rootPane checking is enabled.
|
void |
update(Graphics g)
This method simply calls paint and returns.
|
addNotify, dispose, getTitle, hide, isModal, isResizable, isUndecorated, setModal, setResizable, setTitle, setUndecorated, show
addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getGraphicsConfiguration, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, isActive, isAlwaysOnTop, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setAlwaysOnTop, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, toBack, toFront
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
protected AccessibleContext accessibleContext
protected boolean rootPaneCheckingEnabled
public JDialog()
public JDialog(Dialog owner)
owner
- The owner of the JDialog.public JDialog(Dialog owner, boolean modal)
owner
- The owner of the JDialog.modal
- Whether the JDialog is modal.public JDialog(Dialog owner, String title)
owner
- The owner of the JDialog.title
- The title of the JDialog.public JDialog(Dialog owner, String title, boolean modal)
owner
- The owner of the JDialog.title
- The title of the JDialog.modal
- Whether the JDialog is modal.public JDialog(Dialog owner, String title, boolean modal, GraphicsConfiguration gc)
owner
- The owner of the JDialog.title
- The title of the JDialog.modal
- Whether the JDialog is modal.gc
- The Graphics Configuration to use.public JDialog(Frame owner)
owner
- The owner of the JDialog.public JDialog(Frame owner, boolean modal)
owner
- The owner of the JDialog.modal
- Whether the JDialog is modal.public JDialog(Frame owner, String title)
owner
- The owner of the JDialog.title
- The title of the JDialog.public JDialog(Frame owner, String title, boolean modal)
owner
- The owner of the JDialog.title
- The title of the JDialog.modal
- Whether the JDialog is modal.public JDialog(Frame owner, String title, boolean modal, GraphicsConfiguration gc)
owner
- The owner of the JDialog.title
- The title of the JDialog.modal
- Whether the JDialog is modal.gc
- The Graphics Configuration to use.protected void dialogInit()
public static boolean isDefaultLookAndFeelDecorated()
public static void setDefaultLookAndFeelDecorated(boolean defaultLookAndFeelDecorated)
defaultLookAndFeelDecorated
- Whether the window
decorations are Look and Feel provided.public Dimension getPreferredSize()
getPreferredSize
in class Container
Component.getMinimumSize()
,
Component.setPreferredSize(Dimension)
,
LayoutManager
public JMenuBar getJMenuBar()
public void setJMenuBar(JMenuBar menubar)
menubar
- The JMenuBar to use.public void setLayout(LayoutManager manager)
public void setLayeredPane(JLayeredPane layeredPane)
setLayeredPane
in interface RootPaneContainer
layeredPane
- The JLayeredPane to use.public JLayeredPane getLayeredPane()
getLayeredPane
in interface RootPaneContainer
public JRootPane getRootPane()
getRootPane
in interface RootPaneContainer
protected void setRootPane(JRootPane root)
root
- The JRootPane to use.protected JRootPane createRootPane()
public Container getContentPane()
getContentPane
in interface RootPaneContainer
public void setContentPane(Container contentPane)
setContentPane
in interface RootPaneContainer
contentPane
- The ContentPane to use with the JDialog.public Component getGlassPane()
getGlassPane
in interface RootPaneContainer
public void setGlassPane(Component glassPane)
setGlassPane
in interface RootPaneContainer
glassPane
- The GlassPane for this JDialog.protected void addImpl(Component comp, Object constraints, int index)
protected boolean isRootPaneCheckingEnabled()
protected void setRootPaneCheckingEnabled(boolean enabled)
enabled
- Whether rootPane checking is enabled.public void update(Graphics g)
update
in class Container
g
- The Graphics object to paint with.Component.paint(Graphics)
,
Component.repaint()
protected void processWindowEvent(WindowEvent e)
processWindowEvent
in class Window
e
- The WindowEvent.public void setDefaultCloseOperation(int operation)
operation
- The action to take.public int getDefaultCloseOperation()
protected String paramString()
paramString
in class Dialog
public AccessibleContext getAccessibleContext()
getAccessibleContext
in interface Accessible
getAccessibleContext
in class Dialog