Class sfclasses.StringDialog
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class sfclasses.StringDialog

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Window
                           |
                           +----java.awt.Frame
                                   |
                                   +----sfclasses.StringDialog

public class StringDialog
extends Frame
Dialog Box to input a string
The dialog box contains a text input field to enter a string, an OK button and a Cancel button. It is a subclass of Frame because when deriving it from Dialog, it does not work correctly with Netscape.

Variable Index

 o CANCEL
 o OK

Constructor Index

 o StringDialog(Frame, String)
 o StringDialog(Frame, String, String)
Initialize dialog box
After creating and showing the dialog, call getAnswer() or getString() to wait until the user closes has finished.

Method Index

 o getAnswer()
Get the answer.
 o getString()
Get the string the user has entered.
 o handleEvent(Event)
Event handler.

Variables

 o OK
  public final static int OK
 o CANCEL
  public final static int CANCEL

Constructors

 o StringDialog
  public StringDialog(Frame parent,
                      String message)
 o StringDialog
  public StringDialog(Frame parent,
                      String title,
                      String message)
Initialize dialog box
After creating and showing the dialog, call getAnswer() or getString() to wait until the user closes has finished.
Parameters:
parent - Parent frame
title - Window title string
message - Prompt string

Methods

 o handleEvent
  public boolean handleEvent(Event evt)
Event handler.
Overrides:
handleEvent in class Component
 o getAnswer
  public synchronized int getAnswer()
Get the answer.
Returns:
OK if the user pressed return or pushed the OK button, Cancel if the user pushed the Cancel button. Do not call this method from an event handler.
 o getString
  public synchronized String getString()
Get the string the user has entered. Do not call this method from an event handler.
Returns:
Entered string or null if the user has selected Cancel

All Packages  Class Hierarchy  This Package  Previous  Next  Index