borland Packages  Class Hierarchy  jbcl.control Package  Index 

StringInput component

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

About the StringInput component

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:

  1. Drop the StringInput component on the UI Designer or on the Component Tree.
  2. Set whatever properties you want in the Component Inspector.
  3. Set the frame property to this in the Component Inspector.
  4. Set the visible property to true.

StringInput variables

Variables implemented in this class

StringInput constructors

StringInput properties

*Read-only properties **Write-only properties

Properties implemented in this class

Properties implemented in java.lang.Object

StringInput methods

Methods implemented in this class

Methods implemented in java.lang.Object

StringInput event listeners


StringInput variables

CANCEL

  public static final int CANCEL = ButtonDialog.CANCEL

ID for the Cancel button.

dialog

  protected StringInputDialog dialog

The dialog box that StringInput is a wrapper for.

frame

  protected Frame frame

The parent frame of StringInput.

listeners

  protected transient Array listeners

The array of action listeners (buttons).

OK

  public static final int OK = ButtonDialog.OK

ID for the OK button.

result

  protected int result

Stores the user's choice of buttons, either OK or Cancel.

title

  protected String title

The title text that appears on the title bar of StringInput.

value

  protected String value

Holds the string in the input field.


StringInput constructors

StringInput()

  public StringInput()

Constructs a StringInput dialog with no title, frame or initial value.

StringInput(java.awt.Frame)

  public StringInput(java.awt.Frame frame)

Constructs a StringInput dialog with the given frame.

Parameters:

frame
The Frame component that is the parent of StringInput.

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

  public StringInput(java.awt.Frame frame, java.lang.String title)

Constructs a StringInput dialog with the given frame and title.

Parameters:

frame
The Frame component that is the parent of StringInput.
title
The text that appears on the title bar.

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

  public StringInput(java.awt.Frame frame, java.lang.String title, java.lang.String value)

Constructs a StringInput dialog with the given frame, title, and initial value.

Parameters:

frame
The Frame component that is the parent of StringInput.
title
The text that appears on the title bar.
value
The string in the input field.

StringInput properties

frame

 public Frame getFrame()
 public void setFrame(java.awt.Frame frame)

Determines the parent frame for StringInput.

result

 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

title

 public String getTitle()
 public void setTitle(java.lang.String title)

Determines the text that appears on the title bar of the StringInput component.

value

 public String getValue()
 public void setValue(java.lang.String value)

Determines the text that appears in the input field of StringInput.

visible

 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.


StringInput methods

show()

  public void show()
Displays the StringInput dialog box.

StringInput 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)