borland.jbcl Packages  borland.jbcl Class Hierarchy  borland.jbcl.control 

Message component

java.lang.Object
   +----borland.jbcl.control.Message

About the Message component

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.


Message variables

Variables implemented in this class

Message constructors

Message properties

*Read-only properties **Write-only properties

Properties implemented in this class

Properties implemented in java.lang.Object

Message methods

Methods implemented in this class

Methods implemented in java.lang.Object

Message event listeners


Message variables

CANCEL

  public static final int CANCEL = ButtonDialog.CANCEL
A constant to represent the button set consisting of the "Cancel" button.

NO

  public static final int NO = ButtonDialog.NO
A constant to represent the button set consisting of the "No" button.

OK

  public static final int OK = ButtonDialog.OK
A constant to represent the button set consisting of the "OK" button.

OK_CANCEL

  public static final int OK_CANCEL = ButtonDialog.OK_CANCEL
A constant to represent the button set consisting of the "OK" and "Cancel" buttons.

YES

  public static final int YES = ButtonDialog.YES
A constant to represent the button set consisting of the "Yes" button.

YES_NO

  public static final int YES_NO = ButtonDialog.YES_NO
A constant to represent the button set consisting of the "Yes" and "No" buttons.

YES_NO_CANCEL

  public static final int YES_NO_CANCEL = ButtonDialog.YES_NO_CANCEL
A constant to represent the button set consisting of the "Yes", "No", and "Cancel" buttons.

aList

  protected Array aList
The list of visible button labels.

buttonSet

  protected int buttonSet
Represents which button set to show. The int constants are listed in the table above.

dialog

  protected MessageDialog dialog
The MessageDialog object used for the message box.

frame

  protected Frame frame
The parent frame for the message box.

labels

  protected String[] labels
The 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.

message

  protected String message
The message to show in the message box.

result

  protected int result
Which button was clicked.

title

  protected String title
The title-bar text of the message box.


Message constructors

Message()

  public Message()
Constructs a message box with no parent frame, title-bar text, or message string.

Message(java.awt.Frame)

  public Message(java.awt.Frame frame)
Constructs a message box with the specified parent frame, no title-bar text, and no message string.

Parameters:

frame
The parent frame for the message box.

Message(java.awt.Frame, java.lang.String)

  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:

frame
The parent frame for the message box.
title
The title-bar text for the message box.

Message(java.awt.Frame, java.lang.String, java.lang.String)

  public Message(java.awt.Frame frame, java.lang.String title, java.lang.String msg)
Constructs a message box.

Parameters:

frame
The parent frame for the message box.
title
The title-bar text for the message box.
msg
The message string to display in the message box.

Message properties

buttonSet

 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.

frame

 public Frame getFrame()
 public void setFrame(java.awt.Frame frame)
The parent frame for the message box.

labels

 public String[] getLabels()
 public void setLabels(java.lang.String[] l)
The text to show on the buttons.

message

 public String getMessage()
 public void setMessage(java.lang.String message)
The message string to display in the message box.

result

 public int getResult()
 public void setResult(int i)
The button that was clicked.

title

 public String getTitle()
 public void setTitle(java.lang.String title)
The title-bar text of the message box.

visible

 public boolean isVisible()
 public void setVisible(boolean visible)
Whether the message box is currently visible.


Message methods

show()

  public void show()
Displays the message box using show.


Message event listeners

This component is a source for the following event sets. For information on the standard AWT event sets, see Standard Java events.

action

 public void addActionListener(java.awt.event.ActionListener l)
 public void removeActionListener(java.awt.event.ActionListener l)