org.swixml

Class XDialog


public class XDialog
extends JDialog

XDialog simply extends JDialog to allow instantiation with a parent frame
Version:
$Revision: 1.2 $
Author:
Wolf Paulus

Constructor Summary

XDialog()
Creates a non-modal dialog without a title and without a specified Frame owner.

Method Summary

protected JRootPane
createRootPane()
Overwrites the createRootPane method to install Escape key handling.
void
setIconImage(Image image)
Sets the application frame system icon.
void
show()
Makes the Dialog visible.

Constructor Details

XDialog

public XDialog()
            throws HeadlessException
Creates a non-modal dialog without a title and without a specified Frame owner. A shared, hidden frame will be set as the owner of the dialog.

This constructor sets the component's locale property to the value returned by JComponent.getDefaultLocale.

setLocationRelativeTo is called for the instanced dialog if a parent could be provided by the SwingEngine.

See Also:
GraphicsEnvironment.isHeadless, JComponent.getDefaultLocale, Window.setLocationRelativeTo

Method Details

createRootPane

protected JRootPane createRootPane()
Overwrites the createRootPane method to install Escape key handling.
  When using the JDialog window through a JOptionPane, you do not have to install the Escape key handling,
  as the basic look-and-feel class for the option pane (BasicOptionPaneUI) already does this for you.
 
Returns:
JRootPane - the rootpane with some keyboard actions registered.

setIconImage

public void setIconImage(Image image)
Sets the application frame system icon.
Note:
The provided icon is only applied if an enclosing frame doesn't really exists yet or does not have an icon set.
Parameters:
image - Image the image to become the app's system icon.

show

public void show()
Makes the Dialog visible. If the dialog and/or its owner are not yet displayable, both are made displayable. The dialog will be validated prior to being made visible. If the dialog is already visible, this will bring the dialog to the front.

If the dialog is modal and is not already visible, this call will not return until the dialog is hidden by calling hide or dispose. It is permissible to show modal dialogs from the event dispatching thread because the toolkit will ensure that another event pump runs while the one which invoked this method is blocked.

See Also:
Component.hide, Component.isDisplayable, Component.validate, Dialog.isModal

Copyright B) 2002 - 2005 - Wolf Paulus - CarlsbadCubes.com . All rights reserved.