ch.aplu.jgamegrid
Class GGInputDouble

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

public class GGInputDouble
extends java.lang.Object

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


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

Constructor Detail

GGInputDouble

public GGInputDouble(java.lang.String title,
                     java.lang.String prompt,
                     double 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 value put in the text field

GGInputDouble

public GGInputDouble(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 double show()
Returns the user input. When the Ok button is clicked the entry is verified to have the correct data type. If rejected, the dialog is shown again. When the Cancel button is clicked, the program terminates.

Returns:
the verified user entry