| |
|
| javax.swing.JTextField jacareto.toolkit.swing.IntegerTextField
IntegerTextField | public class IntegerTextField extends JTextField (Code) | | A text field which just allows input of integer numbers. BUGS: You can insert non-integer text
with copy&paste at the moment.
author: Christian Spannagel version: 1.0 |
Constructor Summary | |
public | IntegerTextField(int columns) Creates a new integer text field with the specified number of columns. | public | IntegerTextField(int value, int columns) Creates a new integer text field with the specified initial value and number of columns. |
Method Summary | |
public int | getValue() Returns the integer value of the text field, or 0 if the the actual text is no number ("" or
"-", for example). | public void | setText(String newText) Sets the text of the textfield. | public void | setValue(int value) |
IntegerTextField | public IntegerTextField(int columns)(Code) | | Creates a new integer text field with the specified number of columns. The initial text
value is set to 0.
Parameters: columns - the number of columns. |
IntegerTextField | public IntegerTextField(int value, int columns)(Code) | | Creates a new integer text field with the specified initial value and number of columns.
Parameters: value - the initial integer value Parameters: columns - the number of columns. |
getValue | public int getValue()(Code) | | Returns the integer value of the text field, or 0 if the the actual text is no number ("" or
"-", for example).
the value |
setText | public void setText(String newText)(Code) | | Sets the text of the textfield. You should not use this method, but the method
IntegerTextField.setValue(int) .
Parameters: newText - The new text of the text field. The text must be an integer or the emptystring or null . In the second and the third case the text will be setto 0. |
setValue | public void setValue(int value)(Code) | | Sets the value of the text field to the specified value
Parameters: value - the new value of the text field |
|
|
|