|
||||||||||
| 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.JPanel
stella.jview.JIncrementField
public class JIncrementField
A class providing an editable input field along with a plus-minus box for increase/decrease of the input value. When the value is queried, the string in the input field is read and interpreted as an integer. A typical JIncrementField looks like this:

| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JPanel |
|---|
JPanel.AccessibleJPanel |
| 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.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
static int |
DEFSIZE
The default input size of the text field (3). |
static int |
DEFVALUE
The default input value at construct (0). |
private JTextField |
input
The text field for number input. |
private JPlusMinusBox |
pm
The plus-minus box for stepwize increase/decrease of the value. |
| 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 java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
JIncrementField()
Constructs a new increment field with default properties. |
|
JIncrementField(int width)
Constructs a new increment field with the given input field width. |
|
JIncrementField(int width,
Color fore,
Color back)
Constructs a new increment field with the given input field width and the stated colors. |
|
| Method Summary | |
|---|---|
void |
actionPerformed(ActionEvent ae)
Receives action events from the plus/minus buttons. |
int |
getValue()
Retrieves the input value. |
void |
setInitValue(int initval)
Sets the initial value. |
protected void |
setValue(int newval)
Sets the value of the input field. |
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int DEFSIZE
public static final int DEFVALUE
private JTextField input
private JPlusMinusBox pm
| Constructor Detail |
|---|
public JIncrementField()
public JIncrementField(int width)
public JIncrementField(int width,
Color fore,
Color back)
| Method Detail |
|---|
public void setInitValue(int initval)
public int getValue()
protected void setValue(int newval)
public void actionPerformed(ActionEvent ae)
actionPerformed in interface ActionListener
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||