MessageDialog demo

MessageDialog is provided as a basic AWT message dialog in the style of JOptionPane. It is designed to be Java 1.1 compatible, for use in applets that do version checking.

Type a message in the TextField and hit enter to see the text displayed within a Label in the dialog. Text from the TextArea will be displayed within a scrollable TextArea when the 'Show' button is activated.

The dialog can be dismissed by activating the OK button, or typing the 'escape' key.

Usage

To use the MessageDialog:

  • Add the messagedialog.jar to the applet archive element.
  • From the Java code
    import org.pscode.tool.applet.URLTransformer;
    
    ...
    // instantiate a new dialog with the applet as owner
    MessageDialog dialog = new MessageDialog(this);
    // if needed, change the public attributes before calling init()
    dialog.textAreaRows = 5;
    dialog.closeMessage = "Cancel";
    // construct the GUI
    dialog.init();
    ...
    // message required in scrollable TextArea..
    dialog.showMessage(multiLineMessage);
    ...
    // message required in Label..
    dialog.showMessage(new Label("Cannot open file!"));
© 2003, 2004, 2005, 2006, 2007, 2008 by Andrew Thompson. All rights reserved.
Web hosting compliments of
Java Web Hosting
MessageDialog demo

MessageDialog demo

MessageDialog is provided as a basic AWT message dialog in the style of JOptionPane. It is designed to be Java 1.1 compatible, for use in applets that do version checking.

Type a message in the TextField and hit enter to see the text displayed within a Label in the dialog. Text from the TextArea will be displayed within a scrollable TextArea when the 'Show' button is activated.

The dialog can be dismissed by activating the OK button, or typing the 'escape' key.

Usage

To use the MessageDialog:

  • Add the messagedialog.jar to the applet archive element.
  • From the Java code
    import org.pscode.tool.applet.URLTransformer;
    
    ...
    // instantiate a new dialog with the applet as owner
    MessageDialog dialog = new MessageDialog(this);
    // if needed, change the public attributes before calling init()
    dialog.textAreaRows = 5;
    dialog.closeMessage = "Cancel";
    // construct the GUI
    dialog.init();
    ...
    // message required in scrollable TextArea..
    dialog.showMessage(multiLineMessage);
    ...
    // message required in Label..
    dialog.showMessage(new Label("Cannot open file!"));
© 2003-2010 by Andrew Thompson. All rights reserved.
Web hosting compliments of Java Web Hosting.
Java Web Hosting