Class JValueField

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, Scrollable, SwingConstants
Direct Known Subclasses:
JIntegerField

public abstract class JValueField extends JTextField
Abstract base class for text field controls that work with a simple value such as JIntegerField. Provides methods to add and remove listeners for value changes offering a simpler API than messing about with Swing KeyListener and DocumentListener classes.
Since:
2.6.1
Author:
Michael Bedward
See Also:
  • Constructor Details

    • JValueField

      public JValueField()
      Default constructor
  • Method Details

    • addValueChangedListener

      public void addValueChangedListener(ValueChangedListener listener)
      Register a new listener. If the listener is already registered this method does nothing.
      Parameters:
      listener - the listener to register
    • removeValueChangedListener

      public void removeValueChangedListener(ValueChangedListener listener)
      Remove the given listener. If the listener is not registered this method does nothing.
      Parameters:
      listener - the listener to remove
    • fireValueChangedEvent

      protected void fireValueChangedEvent(ValueChangedEvent ev)
      Notify listeners of a value change
      Parameters:
      ev - the event with details of the value change