ch.aplu.util
Class MessageDialog

java.lang.Object
  extended by ch.aplu.util.MessageDialog

public class MessageDialog
extends java.lang.Object

A simple message dialog (with no prompt button). The dialog is modeless, e.g. it "floats" while the application continues.

All Swing methods are invoked in the EDT.


Constructor Summary
MessageDialog(java.awt.Component parent, java.lang.String message)
          Same as MessageDialog(parent, message, iconPath) with iconPath = null.
MessageDialog(java.awt.Component parent, java.lang.String message, java.lang.String iconPath)
          Construct a dialog with given message, which is not yet shown. show() will display the dialog in the center of the given component.
MessageDialog(java.lang.String message)
          Same as MessageDialog(parent, message, iconPath) with parent = null and iconPath = null.
 
Method Summary
 MessageDialog close()
          Hide the modeless message dialog previously shown.
 javax.swing.JDialog getDialog()
          Return the dialog.
 MessageDialog show()
          Show a modeless message dialog with given message.
 MessageDialog show(boolean exitOnClose)
          Same as show().
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageDialog

public MessageDialog(java.awt.Component parent,
                     java.lang.String message,
                     java.lang.String iconPath)
Construct a dialog with given message, which is not yet shown. show() will display the dialog in the center of the given component.
If parent = null, a standalone window with a title bar containing the close button only will be used. Clicking the close button will hide the window, but not terminate the application.

Runs in the Event Dispatch Thread (EDT).


MessageDialog

public MessageDialog(java.awt.Component parent,
                     java.lang.String message)
Same as MessageDialog(parent, message, iconPath) with iconPath = null.


MessageDialog

public MessageDialog(java.lang.String message)
Same as MessageDialog(parent, message, iconPath) with parent = null and iconPath = null.

Method Detail

show

public MessageDialog show()
Show a modeless message dialog with given message. Runs in the Event Dispatch Thread (EDT). The dialog is modeless (the method does not block). Return a reference to the current instance.


show

public MessageDialog show(boolean exitOnClose)
Same as show(). If exitOnClose = true, the process is terminated when the close button in the title bar is clicked.


close

public MessageDialog close()
Hide the modeless message dialog previously shown. May be reshown calling show(). Return a reference to the current instance.


getDialog

public javax.swing.JDialog getDialog()
Return the dialog.