javabook
Class MessageBox

java.lang.Object
  extended byjavabook.JavaBookDialog
      extended byjavabook.MessageBox

public class MessageBox
extends JavaBookDialog

This dialog is for displaying a single line of text. This dialog is intended for displaying a short warning or error message. The width of this dialog is adjusted to fit the displayed message and the dialog is placed at the center of the screen, unless you change it by using calling the setLocation method.

This class is provided as freeware. You are free to use as provided or modify to your heart's content. But you use it at your own risk. No implied or explicit warranty is given.


Field Summary
 
Fields inherited from class javabook.JavaBookDialog
ERROR_ICON, INFO_ICON, NO_ICON, QUESTION_ICON, WARNING_ICON
 
Constructor Summary
MessageBox(java.awt.Frame owner)
          Default constructor.
MessageBox(java.awt.Frame owner, boolean modal)
          Constructs this dialog with 'owner' as its owner and display this dialog as modal if the parameter is true.
 
Method Summary
 void show(double number)
          Displays the real number after converting it to a string.
 void show(double number, int icon)
          Displays the real number after converting it to a string.
 void show(double number, int x, int y)
          Displays the real number after converting it to a string.
 void show(double number, int x, int y, int icon)
          Displays the real number after converting it to a string.
 void show(long number)
          Displays the integer value after converting it to a string.
 void show(long number, int icon)
          Displays the integer value after converting it to a string.
 void show(long number, int x, int y)
          Displays the integer value after converting it to a string.
 void show(long number, int x, int y, int icon)
          Displays the integer value after converting it to a string.
 void show(java.lang.String text)
          Displays the String value.
 void show(java.lang.StringBuffer text)
          Displays the StringBuffer value after conveting it to a string.
 void show(java.lang.StringBuffer text, int icon)
          Displays the StringBuffer value after conveting it to a string.
 void show(java.lang.StringBuffer text, int x, int y)
          Displays the StringBuffer value after conveting it to a string.
 void show(java.lang.StringBuffer text, int x, int y, int icon)
          Displays the StringBuffer value after conveting it to a string.
 void show(java.lang.String text, int icon)
          Displays the String value.
 void show(java.lang.String text, int x, int y)
          Displays the String value.
 void show(java.lang.String text, int x, int y, int icon)
          Displays the String value.
 
Methods inherited from class javabook.JavaBookDialog
setIcon, setLocation, setTitle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageBox

public MessageBox(java.awt.Frame owner)
Default constructor.

Parameters:
owner - a Frame object owner of this dialog

MessageBox

public MessageBox(java.awt.Frame owner,
                  boolean modal)
Constructs this dialog with 'owner' as its owner and display this dialog as modal if the parameter is true. Otherwise, display this dialog as modeless.

Parameters:
owner - a Frame object owner of this dialog
modal - true for modal dialog; false for modeless dialog
Method Detail

show

public void show(long number)
Displays the integer value after converting it to a string.

Parameters:
number - the integer value to display

show

public void show(double number)
Displays the real number after converting it to a string.

Parameters:
number - the real value to display

show

public void show(java.lang.String text)
Displays the String value.

Parameters:
text - the String value to display

show

public void show(java.lang.StringBuffer text)
Displays the StringBuffer value after conveting it to a string.

Parameters:
text - the StringBuffer value to display

show

public void show(long number,
                 int icon)
Displays the integer value after converting it to a string. Uses the designated icon in this dialog. Designated icon is used only once here in this display. If you want all subsequent shows to display the same icon, then use the setIcon method.

Parameters:
number - the integer value to display
icon - the icon to display

show

public void show(double number,
                 int icon)
Displays the real number after converting it to a string. Uses the designated icon in this dialog. Designated icon is used only once here in this display. If you want all subsequent shows to display the same icon, then use the setIcon method.

Parameters:
number - the real value to display
icon - the icon to display

show

public void show(java.lang.String text,
                 int icon)
Displays the String value. Uses the designated icon in this dialog. Designated icon is used only once here in this display. If you want all subsequent shows to display the same icon, then use the setIcon method.

Parameters:
text - the String value to display
icon - the icon to display

show

public void show(java.lang.StringBuffer text,
                 int icon)
Displays the StringBuffer value after conveting it to a string. Uses the designated icon in this dialog. Designated icon is used only once here in this display. If you want all subsequent shows to display the same icon, then use the setIcon method.

Parameters:
text - the StringBuffer value to display
icon - the icon to display

show

public void show(long number,
                 int x,
                 int y)
Displays the integer value after converting it to a string. Position this dialog at (x, y).

Parameters:
number - the integer value to display
x - the x-coordinate of this dialog's origin
y - the y-coordiante of this dialog's origin

show

public void show(double number,
                 int x,
                 int y)
Displays the real number after converting it to a string. Position this dialog at (x, y).

Parameters:
number - the real value to display
x - the x-coordinate of this dialog's origin
y - the y-coordiante of this dialog's origin

show

public void show(java.lang.String text,
                 int x,
                 int y)
Displays the String value. Position this dialog at (x, y).

Parameters:
text - the String value to display
x - the x-coordinate of this dialog's origin
y - the y-coordiante of this dialog's origin

show

public void show(java.lang.StringBuffer text,
                 int x,
                 int y)
Displays the StringBuffer value after conveting it to a string. Position this dialog at (x, y).

Parameters:
text - the StringBuffer value to display
x - the x-coordinate of this dialog's origin
y - the y-coordiante of this dialog's origin

show

public void show(long number,
                 int x,
                 int y,
                 int icon)
Displays the integer value after converting it to a string. Position this dialog at (x, y).

Parameters:
number - the integer value to display
x - the x-coordinate of this dialog's origin
y - the y-coordiante of this dialog's origin
icon - the icon to display

show

public void show(double number,
                 int x,
                 int y,
                 int icon)
Displays the real number after converting it to a string. Position this dialog at (x, y).

Parameters:
number - the real value to display
x - the x-coordinate of this dialog's origin
y - the y-coordiante of this dialog's origin
icon - the icon to display

show

public void show(java.lang.String text,
                 int x,
                 int y,
                 int icon)
Displays the String value. Position this dialog at (x, y).

Parameters:
text - the String value to display
x - the x-coordinate of this dialog's origin
y - the y-coordiante of this dialog's origin
icon - the icon to display

show

public void show(java.lang.StringBuffer text,
                 int x,
                 int y,
                 int icon)
Displays the StringBuffer value after conveting it to a string. Position this dialog at (x, y).

Parameters:
text - the StringBuffer value to display
x - the x-coordinate of this dialog's origin
y - the y-coordiante of this dialog's origin
icon - the icon to display