All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.java.swing.JDialog

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Window
                           |
                           +----java.awt.Dialog
                                   |
                                   +----com.sun.java.swing.JDialog

public class JDialog
extends Dialog
The JDialog component contains a JRootPane as it's only child. The contentPane() should be the parent of any children of the JDialog. From the older java.awt.Window object you would normally do something:
       dialog.add(child);
 
Using JDialog the proper semantic is:
       dialog.getContentPane().add(child);
 
The same is true of setting LayoutManagers, removing components, listing children, etc. All these methods should normally be sent to the contentPane() instead of the JDialog itself. The contentPane() will always be non-null. Attempting to set it to null will cause the JDialog to throw an exception. The default contentPane() will have a BorderLayout manager set on it.

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

See Also:
JRootPane

Variable Index

 o rootPane

Constructor Index

 o JDialog(JFrame)
 o JDialog(JFrame, boolean)
 o JDialog(JFrame, String)
 o JDialog(JFrame, String, boolean)

Method Index

 o createRootPane()
Called by the constructor methods to create the default rootPane.
 o dialogInit()
Called by the constructors to init the JDialog properly.
 o getContentPane()
 o getGlassPane()
 o getLayeredPane()
 o getRootPane()
 o setContentPane(Container)
 o setGlassPane(Component)
 o setLayeredPane(JLayeredPane)
 o setRootPane(JRootPane)

Variables

 o rootPane
 protected JRootPane rootPane

Constructors

 o JDialog
 public JDialog(JFrame parent)
 o JDialog
 public JDialog(JFrame parent,
                boolean modal)
 o JDialog
 public JDialog(JFrame parent,
                String title)
 o JDialog
 public JDialog(JFrame parent,
                String title,
                boolean modal)

Methods

 o dialogInit
 protected void dialogInit()
Called by the constructors to init the JDialog properly.

 o createRootPane
 protected JRootPane createRootPane()
Called by the constructor methods to create the default rootPane.

 o setContentPane
 public void setContentPane(Container content)
 o getContentPane
 public Container getContentPane()
 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()

All Packages  Class Hierarchy  This Package  Previous  Next  Index