ccs.utils
Class StringDialog

java.lang.Object
  extended by ccs.utils.StringDialog

public class StringDialog
extends java.lang.Object

A Dialog box which allows the user to enter a single string of text. Implemented as a wrapper around JOptionPane, so shares a common window-title with MsgBox and others.

See Also:
MsgBox

Constructor Summary
StringDialog(java.awt.Component frame, java.lang.String title)
          Constructs a new string dialog which is initially invisible.
StringDialog(java.awt.Component frame, java.lang.String title, java.lang.String defaultStr)
          Constructs a new string dialog which is initially invisible, and whose text box contains the supplied string.
 
Method Summary
 java.lang.String getResult()
          Returns the result; the string entered if the user selects OK, null for cancel.
 void show()
          Displays the dialog, modally: the app will block until the user clears the dialog.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringDialog

public StringDialog(java.awt.Component frame,
                    java.lang.String title,
                    java.lang.String defaultStr)
Constructs a new string dialog which is initially invisible, and whose text box contains the supplied string.

Parameters:
frame - The parent frame; may be null.
title - The title of the dialog.
defaultStr - The string initially in the text field.

StringDialog

public StringDialog(java.awt.Component frame,
                    java.lang.String title)
Constructs a new string dialog which is initially invisible.

Parameters:
frame - The parent frame; may be null.
title - The title of the dialog.
Method Detail

show

public void show()
Displays the dialog, modally: the app will block until the user clears the dialog.


getResult

public java.lang.String getResult()
Returns the result; the string entered if the user selects OK, null for cancel. If the user returned an empty text field, an empty string is returned (and not null). Trailing and leading spaces are not trimmed.