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.
-
CANCEL
-
-
OK
-
-
StringDialog(Frame, String)
-
-
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.
-
getAnswer()
-
Get the answer.
-
getString()
- Get the string the user has entered.
-
handleEvent(Event)
-
Event handler.
OK
public final static int OK
CANCEL
public final static int CANCEL
StringDialog
public StringDialog(Frame parent,
String message)
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
handleEvent
public boolean handleEvent(Event evt)
- Event handler.
- Overrides:
- handleEvent in class Component
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.
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