Class MessageDialog

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class MessageDialog extends Dialog
Class MessageDialog displays a dialog window that contains the supplied message. The only action that can be taken by the user on this dialog is to close the dialog.

This dialog is useful for displaying error messages. For example:

    try {
       ...
    } catch (Exception e) {
       MessageDialog msg_dialog = new MessageDialog( my_frame, true, e.getLocalizedMessage() );
       msg_dialog.show();
    }
  


Supported API:true

Extendable: false
See Also:
  • Constructor Details

    • MessageDialog

      public MessageDialog(Frame parent, boolean modal)
      Constructor for MessageDialog
      Parameters:
      parent - the Frame owner of this dialog
      modal - if true, dialog blocks input to the parent window when shown
      See Also:
    • MessageDialog

      public MessageDialog(Frame parent, String title, boolean modal)
      Constructor for MessageDialog.
      Parameters:
      parent - the owner of this dialog
      title - the title to be displayed on this dialog
      modal - if true, dialog blocks input to the parent window when shown
      See Also:
    • MessageDialog

      public MessageDialog(Component parent, boolean modal)
      Constructor which takes in a Component instead of a Frame as the parent. This constructor is useful for Applets that would like to display a dialog. If a frame cannot be found by traversing the hierarchy of the given component, an IllegalArgumentException will be thrown.
      Parameters:
      parent - the parent Component
      modal - a boolean value indicating whether or not the dialog blocks input to the parent window when shown.

      Supported API:true
    • MessageDialog

      public MessageDialog(Frame parent, String title, boolean modal, String message)
      Constructor for MessageDialog.
      Parameters:
      parent - the owner of this dialog
      title - the title to be displayed on this dialog
      modal - if true, dialog blocks input to the parent window when shown
      message - the message to be displayed in this dialog
      See Also:
    • MessageDialog

      public MessageDialog(Frame parent, boolean modal, String message)
      Constructor for MessageDialog.
      Parameters:
      parent - the owner of this dialog
      modal - if true, dialog blocks input to the parent window when shown
      message - the message to be displayed in this dialog
      See Also: