jbcl.control Package
java.lang.Object +----com.borland.jbcl.control.StringInput
Variables Constructors Properties Methods Event Listeners
Implements WindowListener, Serializable, EventListener
A StringInput
component is a dialog box that contains
a text input box and an OK and a Cancel button. It is used to
obtain a text string from the user.
To display the dialog box at runtime, call the show()
method or set the visible
property to true.
When the user enters a string and chooses OK, the selection is
stored in the value
property.
The dialog box has two buttons, OK and Cancel. Which button
the user chooses to put away the dialog box is stored as the
value of the result
property. The title
property
contains the text that appears on the title bar of the dialog
box's frame.
You can make the StringInput
component appear at
design time:
StringInput
component on the UI
Designer or on the Component Tree.
frame
property to this in
the Component Inspector.
visible
property to true.
public static final int CANCEL = ButtonDialog.CANCEL
protected StringInputDialog dialog
The dialog box that StringInput
is a wrapper for.
protected Frame frame
The parent frame of StringInput
.
protected transient Vector listeners
The array of action listeners (buttons).
public static final int OK = ButtonDialog.OK
protected int result
Stores the user's choice of buttons, either OK or Cancel.
protected String title
The title text that appears on the title bar of StringInput
.
protected String value
Holds the string in the input field.
public StringInput()
Constructs a StringInput
dialog with no title, frame
or initial value.
public StringInput(Frame frame)
Constructs a StringInput
dialog with the given frame.
Parameters:
frame
Frame
component that is the parent of StringInput
.
public StringInput(Frame frame, String title)
Constructs a StringInput
dialog with the given frame
and title.
Parameters:
frame
Frame
component that is the parent of StringInput
.
title
public StringInput(Frame frame, String title, String value)
Constructs a StringInput
dialog with the given frame,
title, and initial value.
Parameters:
frame
Frame
component that is the parent of StringInput
.
title
value
public Frame getFrame() public void setFrame(Frame frame)
Determines the parent frame for StringInput
.
public int getResult() public void setResult(int i)
Contains the value of the button the user chose to close the
dialog box. The int
value must be one of the
StringInput
variables
public String getTitle() public void setTitle(String title)
Determines the text that appears on the title bar of
the StringInput
component.
public String getValue() public void setValue(String value)
Determines the text that appears in the input field of StringInput
.
public boolean isVisible() public void setVisible(boolean visible)
Determines whether the StringInput
component is
visible. If true, the StringInput
component is
visible; if false, the component is not visible.
public void show()Displays the
StringInput
dialog box.
public void addActionListener(ActionListener l) public void removeActionListener(ActionListener l)