ch.aplu.jgamegrid
Class GGInputString

java.lang.Object
  extended by ch.aplu.jgamegrid.GGInputString

public class GGInputString
extends java.lang.Object

Class to provide a modal dialog with one text field and a Ok and Cancel button based on JOptionPane.


Constructor Summary
GGInputString(java.lang.String title, java.lang.String prompt)
          Creates a modal dialog with given title, prompt and no initial value.
GGInputString(java.lang.String title, java.lang.String prompt, java.lang.String init)
          Creates a modal dialog with given title, prompt and initial value.
 
Method Summary
 java.lang.String show()
          Returns the user input when the Ok button is clicked.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GGInputString

public GGInputString(java.lang.String title,
                     java.lang.String prompt,
                     java.lang.String init)
Creates a modal dialog with given title, prompt and initial value. To show the dialog and get the user input, call show().

Parameters:
title - the title string in the title bar
prompt - the prompt string
init - an initial text put in the text field

GGInputString

public GGInputString(java.lang.String title,
                     java.lang.String prompt)
Creates a modal dialog with given title, prompt and no initial value. To show the dialog and get the user input, call show().

Parameters:
title - the title string in the title bar
prompt - the prompt string
Method Detail

show

public java.lang.String show()
Returns the user input when the Ok button is clicked. Leading and trailing white spaces are removed. When the Cancel button is clicked, the program terminates.

Returns:
the user entry