|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.text.JTextComponent
javax.swing.JTextField
com.samskivert.swing.IntField
public class IntField
A text field that will only allow editing of integer values within the specified range.
| Nested Class Summary | |
|---|---|
protected static class |
IntField.IntDocument
Our own special Document class. |
| Nested classes/interfaces inherited from class javax.swing.JTextField |
|---|
JTextField.AccessibleJTextField |
| Nested classes/interfaces inherited from class javax.swing.text.JTextComponent |
|---|
JTextComponent.AccessibleJTextComponent, JTextComponent.KeyBinding |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
protected static NumberFormat |
_formatter
Formats and parses numbers with commas in them. |
protected int |
_maxValue
min/max |
protected int |
_minValue
min/max |
| Fields inherited from class javax.swing.JTextField |
|---|
notifyAction |
| Fields inherited from class javax.swing.text.JTextComponent |
|---|
DEFAULT_KEYMAP, FOCUS_ACCELERATOR_KEY |
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface javax.swing.SwingConstants |
|---|
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
IntField()
Create an IntField with the range 0 - Integer.MAX_VALUE, with 0 as the initial value. |
|
IntField(int maxValue)
Create an IntField with the specified maximum. |
|
IntField(int minValue,
int maxValue)
Create an IntField with the specified minimum and maximum, with the minimum value initially displayed. |
|
IntField(int initial,
int minValue,
int maxValue)
Create an IntField with the specified initial, minimum, and maximum values. |
|
| Method Summary | |
|---|---|
static String |
format(int value)
Format the specified monetary value into a string. |
int |
getValue()
Return the int that is represented by this field. |
void |
setMaxValue(int maxValue)
Change the current max value. |
void |
setMinValue(int minValue)
Change the current min value. |
void |
setValue(int value)
Set the text to the value specified. |
static int |
unformat(String text)
Parse numbers, with commas being ok. |
static int |
unformatSafe(String text)
Parse numbers, don't throw exceptions. |
protected void |
validateMinMax(int minValue,
int maxValue)
Validate min/max. |
protected void |
validateText()
Ensure that the value we're displaying is between the minimum and the maximum. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected int _minValue
protected int _maxValue
protected static NumberFormat _formatter
| Constructor Detail |
|---|
public IntField()
public IntField(int maxValue)
public IntField(int minValue,
int maxValue)
public IntField(int initial,
int minValue,
int maxValue)
| Method Detail |
|---|
protected void validateMinMax(int minValue,
int maxValue)
public int getValue()
public void setValue(int value)
public void setMinValue(int minValue)
public void setMaxValue(int maxValue)
protected void validateText()
public static String format(int value)
public static int unformat(String text)
throws ParseException
ParseExceptionpublic static int unformatSafe(String text)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||