net.sourceforge.jiu.gui.awt.dialogs
Class IntegerDialog
Dialog
net.sourceforge.jiu.gui.awt.dialogs.IntegerDialog
- ActionListener, AdjustmentListener, KeyListener
public class IntegerDialog
extends Dialog
implements ActionListener, AdjustmentListener, KeyListener
An AWT dialog to select an int
value from a given interval.
IntegerDialog(Frame owner, String title, String message, int minValue, int initialValue, int maxValue, String okText, String cancelText) - Creates an IntegerDialog, a modal dialog that lets the user select one int
value from a given interval.
|
cancel
private Button cancel
maxValue
private int maxValue
minValue
private int minValue
result
private Integer result
scrollbar
private Scrollbar scrollbar
valueTextField
private TextComponent valueTextField
IntegerDialog
public IntegerDialog(Frame owner,
String title,
String message,
int minValue,
int initialValue,
int maxValue,
String okText,
String cancelText)
Creates an IntegerDialog, a modal dialog that lets the user select one int
value from a given interval.
owner
- the java.awt.Frame
this dialog will belong totitle
- the text that will be displayed in the title bar of the dialogmessage
- the message text that will be displayed in the upper part of the dialogminValue
- the minimum allowed int value to be selected by the userinitialValue
- the int value that is selected when the dialog first pops upmaxValue
- the maximum allowed int value to be selected by the userokText
- the value for OK (just "OK"
in English
programs, may be different for other natural languagescancelText
- the value for Cancel (just "Cancel"
in English
programs, may be different for other natural languages
actionPerformed
public void actionPerformed(ActionEvent e)
Hides (closes) this dialog if the OK button was source of the action event
(e.g. if the button was pressed).
adjustmentValueChanged
public void adjustmentValueChanged(AdjustmentEvent e)
getValue
public Integer getValue()
handleKeys
public void handleKeys(KeyEvent e)
keyPressed
public void keyPressed(KeyEvent e)
keyReleased
public void keyReleased(KeyEvent e)
keyTyped
public void keyTyped(KeyEvent e)
setScrollbarFromTextField
private void setScrollbarFromTextField()