borland.jbcl Packages borland.jbcl Class Hierarchy borland.jbcl.control
java.lang.Object +----borland.jbcl.control.Message
Variables Constructors Properties Methods Event Listeners
Implements WindowListener, EventListener
A message box component with a standard button set. A wrapper for MessageDialog, which extends jbcl.control.ButtonDialog.
This component appears on the Component Palette.
The following button sets are available:
OK | "OK" button. |
YES | "Yes" button. |
NO | "No" button |
CANCEL | "Cancel" button |
OK_CANCEL | "OK" and "Cancel" buttons |
YES_NO | "Yes" and "No" buttons |
YES_NO_CANCEL | "Yes", "No", and "Cancel" buttons |
You must set the frame property before you use this class. In the Component Inspector window, you usually need to set the frame property to this to get the Message dialog to appear.
public static final int CANCEL = ButtonDialog.CANCELA constant to represent the button set consisting of the "Cancel" button.
public static final int NO = ButtonDialog.NOA constant to represent the button set consisting of the "No" button.
public static final int OK = ButtonDialog.OKA constant to represent the button set consisting of the "OK" button.
public static final int OK_CANCEL = ButtonDialog.OK_CANCELA constant to represent the button set consisting of the "OK" and "Cancel" buttons.
public static final int YES = ButtonDialog.YESA constant to represent the button set consisting of the "Yes" button.
public static final int YES_NO = ButtonDialog.YES_NOA constant to represent the button set consisting of the "Yes" and "No" buttons.
public static final int YES_NO_CANCEL = ButtonDialog.YES_NO_CANCELA constant to represent the button set consisting of the "Yes", "No", and "Cancel" buttons.
protected Array aListThe list of visible button labels.
protected int buttonSetRepresents which button set to show. The int constants are listed in the table above.
protected MessageDialog dialogThe MessageDialog object used for the message box.
protected Frame frameThe parent frame for the message box.
protected String[] labelsThe text to show on the buttons. The underlying buttons are still the standard buttons, functionally, such as "Yes", "No", and "Cancel", but the visible text can be changed, such as to another spoken language.
protected String messageThe message to show in the message box.
protected int resultWhich button was clicked.
protected String titleThe title-bar text of the message box.
public Message()Constructs a message box with no parent frame, title-bar text, or message string.
public Message(java.awt.Frame frame)Constructs a message box with the specified parent frame, no title-bar text, and no message string.
Parameters:
public Message(java.awt.Frame frame, java.lang.String title)Constructs a message box with the specified parent frame and title-bar text, and no message string.
Parameters:
public Message(java.awt.Frame frame, java.lang.String title, java.lang.String msg)Constructs a message box.
Parameters:
public int getButtonSet() public void setButtonSet(int bs)The buttonSet property stores the name of the button set. See the "available button sets" at top.
public Frame getFrame() public void setFrame(java.awt.Frame frame)The parent frame for the message box.
public String[] getLabels() public void setLabels(java.lang.String[] l)The text to show on the buttons.
public String getMessage() public void setMessage(java.lang.String message)The message string to display in the message box.
public int getResult() public void setResult(int i)The button that was clicked.
public String getTitle() public void setTitle(java.lang.String title)The title-bar text of the message box.
public boolean isVisible() public void setVisible(boolean visible)Whether the message box is currently visible.
public void show()Displays the message box using show.
public void addActionListener(java.awt.event.ActionListener l) public void removeActionListener(java.awt.event.ActionListener l)