|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JPanel jpicedt.widgets.IncrementableTextField
public class IncrementableTextField
A JComponent that lump together a JSpinner (with a +/- arrow field that allows the user to increment/decrement) and prefix/postfix labels. the field's value.
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 |
---|
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 | |
---|---|
IncrementableTextField(double initialValue,
double increment,
Icon icon,
String postFix)
Creates a new IncrementableTextField with an etched border drawn around it. |
|
IncrementableTextField(double initialValue,
double increment,
Icon icon,
String postFix,
boolean drawBorder)
|
|
IncrementableTextField(double initialValue,
double increment,
JLabel prefix,
JLabel postfix,
boolean drawBorder)
|
Method Summary | |
---|---|
void |
addActionListener(ActionListener l)
adds an ActionListener to the component |
protected void |
fireActionPerformed()
Notify all listeners that have registered interest for notification on this event type. |
String |
getActionCommand()
|
double |
getMaximum()
|
double |
getMinimum()
|
double |
getValue()
|
boolean |
isEnabled()
Return the "enabled" state of this component |
boolean |
isHighBounded()
|
boolean |
isLowBounded()
|
void |
removeActionListener(ActionListener l)
removes an ActionListener from the component |
void |
setActionCommand(String s)
sets the actionCommand for this component to the given string |
void |
setBoundValues(double min,
double max)
sets minimum and maximum bounds for "value" to the given doubles |
void |
setDialogTitle(String title)
sets the title of the JDialog that opens when a NumberFormatException occurs |
void |
setEnabled(boolean b)
set the enable state of this component |
void |
setHighBounded(boolean state)
|
void |
setLowBounded(boolean state)
|
void |
setMaximum(double max)
sets maximum bound for "value" to the given double |
void |
setMinimum(double min)
sets minimum bound for "value" to the given double |
void |
setValue(double value)
sets the DecimalNumberField double value, as well as the internal copy, to the given value, possibly modifying it so that it fits within the limits. |
void |
setValue(Number n)
|
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 |
Constructor Detail |
---|
public IncrementableTextField(double initialValue, double increment, Icon icon, String postFix)
initialValue
- the initial value of the text fieldincrement
- increment by which value get in-/de-cremented when a click occurs on one of the two arrowsicon
- if non-null, icon gets added to the left of the componentpostFix
- if non-null, this string gets added just right of the testfield (it can be use to specify a unit)public IncrementableTextField(double initialValue, double increment, Icon icon, String postFix, boolean drawBorder)
initialValue
- the initial value of the text fieldincrement
- increment by which value get in-/de-cremented when a click occurs on one of the two arrowsicon
- if non-null, gets added to the left of the componentpostFix
- if non-null, gets added just right of the component (it can be use to specify a unit)drawBorder
- if TRUE, draw a border around the componentpublic IncrementableTextField(double initialValue, double increment, JLabel prefix, JLabel postfix, boolean drawBorder)
initialValue
- the initial value of the text fieldincrement
- increment by which value get in-/de-cremented when a click occurs on one of the two arrowsprefix
- if non-null, gets added to the left of the componentpostfix
- if non-null, gets added just right of the component (it can be use to specify a unit)drawBorder
- if TRUE, draw a border around the componentMethod Detail |
---|
public void setBoundValues(double min, double max)
public void setMinimum(double min)
public void setMaximum(double max)
public double getMaximum()
public double getMinimum()
public void setLowBounded(boolean state)
state
- if TRUE, DecimalNumberField's value is low-boundedpublic boolean isLowBounded()
public void setHighBounded(boolean state)
state
- if TRUE, DecimalNumberField's value is high-boundedpublic boolean isHighBounded()
public void setDialogTitle(String title)
public void setActionCommand(String s)
public String getActionCommand()
public double getValue()
public void setValue(double value)
public void setValue(Number n)
public void setEnabled(boolean b)
setEnabled
in class JComponent
public boolean isEnabled()
isEnabled
in class Component
protected void fireActionPerformed()
public void addActionListener(ActionListener l)
public void removeActionListener(ActionListener l)
|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |