public class IncrementableTextField
extends javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
IncrementableTextField(double initialValue,
double increment,
javax.swing.Icon icon,
java.lang.String postFix)
Creates a new IncrementableTextField with an etched border drawn around it.
|
IncrementableTextField(double initialValue,
double increment,
javax.swing.Icon icon,
java.lang.String postFix,
boolean drawBorder) |
IncrementableTextField(double initialValue,
double increment,
javax.swing.JLabel prefix,
javax.swing.JLabel postfix,
boolean drawBorder) |
Modifier and Type | Method and Description |
---|---|
void |
addActionListener(java.awt.event.ActionListener l)
adds an ActionListener to the component
|
protected void |
fireActionPerformed()
Notify all listeners that have registered interest for
notification on this event type.
|
java.lang.String |
getActionCommand() |
double |
getMaximum() |
double |
getMinimum() |
double |
getValue() |
boolean |
isEnabled()
Return the "enabled" state of this component
|
boolean |
isHighBounded() |
boolean |
isLowBounded() |
void |
removeActionListener(java.awt.event.ActionListener l)
removes an ActionListener from the component
|
void |
setActionCommand(java.lang.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(java.lang.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(java.lang.Number n) |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public IncrementableTextField(double initialValue, double increment, javax.swing.Icon icon, java.lang.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, javax.swing.Icon icon, java.lang.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, javax.swing.JLabel prefix, javax.swing.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 componentpublic 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(java.lang.String title)
public void setActionCommand(java.lang.String s)
public java.lang.String getActionCommand()
public double getValue()
public void setValue(double value)
public void setValue(java.lang.Number n)
public void setEnabled(boolean b)
setEnabled
in class javax.swing.JComponent
public boolean isEnabled()
isEnabled
in class java.awt.Component
protected void fireActionPerformed()
public void addActionListener(java.awt.event.ActionListener l)
public void removeActionListener(java.awt.event.ActionListener l)
Submit a bug : syd@jpicedt.org