|
|||||||||
| 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
javamorph.CEditField
public class CEditField
| Nested Class Summary |
|---|
| 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 | |
|---|---|
private JLabel |
key
Show a short description of the input field to the user. |
private int |
max
Maximum valid numerical value. |
private int |
min
Minimum valid numerical value. |
private static long |
serialVersionUID
Java API. |
private JTextField |
value
Text field for user input. |
| 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 | |
|---|---|
CEditField(String key,
int value,
int min,
int max,
boolean edit)
Constructor for numerical value. |
|
CEditField(String key,
String value,
boolean edit)
Constructor for a string value. |
|
| Method Summary | |
|---|---|
private void |
checkValue()
Call back to clip invalid numerical values of the input field. |
void |
focusGained(FocusEvent e)
Event API. |
void |
focusLost(FocusEvent e)
Check the numerical value when the text field loses the input focus. |
int |
getNumber()
Get function. |
String |
getValue()
Get function. |
void |
setValue(int value)
Set function. |
void |
setValue(String value)
Set function. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private static final long serialVersionUID
private JLabel key
private JTextField value
private int min
private int max
| Constructor Detail |
|---|
public CEditField(String key,
int value,
int min,
int max,
boolean edit)
key - Short description of the input field.value - Initial value of the input field.min - Minimum valid numerical value.max - Maximum valid numerical value.edit - When true then the input field is edit able.
public CEditField(String key,
String value,
boolean edit)
key - Short description of the input field.value - Initial value of the input field.edit - When true then the input field is edit able.| Method Detail |
|---|
public int getNumber()
public String getValue()
public void setValue(int value)
value - Numerical value for assignment to the input field.public void setValue(String value)
value - String value for assignment to the input field.private void checkValue()
public void focusGained(FocusEvent e)
focusGained in interface FocusListenerpublic void focusLost(FocusEvent e)
focusLost in interface FocusListener
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||