Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| http://www.jpicedt.org
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## jpicedt.widgets
Class IncrementableTextField

    java.lang.Object
      java.awt.Component
          java.awt.Container
              javax.swing.JComponent
                  javax.swing.JPanel
                      jpicedt.widgets.IncrementableTextField

All Implemented Interfaces:
  Accessible, ImageObserver, MenuContainer, Serializable

public class IncrementableTextField
extends JPanel

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.

Since:
  jpicedt 1.3
Version:
  $Id: IncrementableTextField.java,v 1.6.2.1 2007/09/02 11:56:31 reynal Exp $
Author:
  Sylvain Reynal
See Also:
  Serialized Form

Nested Class Summary

Nested classes inherited from class javax.swing.JPanel
`JPanel.AccessibleJPanel`

Nested classes inherited from class javax.swing.JComponent
`JComponent.AccessibleJComponent`

Nested classes inherited from class java.awt.Container
`Container.AccessibleAWTContainer`

Nested classes inherited from class java.awt.Component
`Component.AccessibleAWTComponent, 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 javax.swing.JComponent
`addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update`

Methods inherited from class java.awt.Container
`add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree`

Methods inherited from class java.awt.Component
`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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### IncrementableTextField

    public IncrementableTextField(double initialValue,
                                  double increment,
                                  Icon icon,
                                  String postFix)

  Creates a new IncrementableTextField with an etched border drawn around it.

Parameters:
  `initialValue` - the initial value of the text field
  `increment` - increment by which value get in-/de-cremented when a click occurs on one of the two arrows
  `icon` - if non-null, icon gets added to the left of the component
  `postFix` - if non-null, this string gets added just right of the testfield (it can be use to specify a unit)

### IncrementableTextField

    public IncrementableTextField(double initialValue,
                                  double increment,
                                  Icon icon,
                                  String postFix,
                                  boolean drawBorder)

Parameters:
  `initialValue` - the initial value of the text field
  `increment` - increment by which value get in-/de-cremented when a click occurs on one of the two arrows
  `icon` - if non-null, gets added to the left of the component
  `postFix` - 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 component

### IncrementableTextField

    public IncrementableTextField(double initialValue,
                                  double increment,
                                  JLabel prefix,
                                  JLabel postfix,
                                  boolean drawBorder)

Parameters:
  `initialValue` - the initial value of the text field
  `increment` - increment by which value get in-/de-cremented when a click occurs on one of the two arrows
  `prefix` - if non-null, gets added to the left of the component
  `postfix` - 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 component

Method Detail

### setBoundValues

    public void setBoundValues(double min,
                               double max)

  sets minimum and maximum bounds for "value" to the given doubles

### setMinimum

    public void setMinimum(double min)

  sets minimum bound for "value" to the given double

### setMaximum

    public void setMaximum(double max)

  sets maximum bound for "value" to the given double

### getMaximum

    public double getMaximum()

  Returns:
    the maximum bound

### getMinimum

    public double getMinimum()

  Returns:
    the minimum bound

### setLowBounded

    public void setLowBounded(boolean state)

  Parameters:
    `state` - if TRUE, DecimalNumberField's value is low-bounded

### isLowBounded

    public boolean isLowBounded()

  Returns:
    TRUE if "value" is low-bounded

### setHighBounded

    public void setHighBounded(boolean state)

  Parameters:
    `state` - if TRUE, DecimalNumberField's value is high-bounded

### isHighBounded

    public boolean isHighBounded()

  Returns:
    TRUE if "value" is high-bounded

### setDialogTitle

    public void setDialogTitle(String title)

  sets the title of the JDialog that opens when a NumberFormatException occurs

### setActionCommand

    public void setActionCommand(String s)

  sets the actionCommand for this component to the given string

### getActionCommand

    public String getActionCommand()

  Returns:
    this component's action command

### getValue

    public double getValue()

  Returns:
    the current double value contained in DecimalNumberField

### setValue

    public 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.

### setValue

    public void setValue(Number n)

### setEnabled

    public void setEnabled(boolean b)

  set the enable state of this component

### isEnabled

    public boolean isEnabled()

  Return the "enabled" state of this component

### fireActionPerformed

    protected void fireActionPerformed()

  Notify all listeners that have registered interest for notification on this event type. The event instance is lazily created using the parameters passed into the fire method.

### addActionListener

    public void addActionListener(ActionListener l)

  adds an ActionListener to the component

### removeActionListener

    public void removeActionListener(ActionListener l)

  removes an ActionListener from the component

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| http://www.jpicedt.org
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Submit a bug : syd@jpicedt.org