Class SpinnerChangerAlt

All Implemented Interfaces:
DateChanger, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, ChangeListener

public class SpinnerChangerAlt extends JPanel implements DateChanger, ChangeListener
A control which allows the user to modify the month and year displayed in a MiniCal component.
See Also:
  • Field Details

  • Constructor Details

    • SpinnerChangerAlt

      public SpinnerChangerAlt()
      Creates a new SpinnerChanger control comprised of 4 directional buttons for cycling through the month/year values, and a label for displaying the current values.
  • Method Details

    • setMiniCalRef

      public void setMiniCalRef(MiniCal m)
      Implements the DateChanger interface. Establishes the MiniCal instance which should be updated when the user changes the month/year.
      Specified by:
      setMiniCalRef in interface DateChanger
    • stateChanged

      public void stateChanged(ChangeEvent e)
      Implements the ChangeListener interface. This method handles the month/year values when the spinner values change
      Specified by:
      stateChanged in interface ChangeListener
      Parameters:
      e - The change event from the spinner
    • requestFocus

      public void requestFocus()
      Overrides:
      requestFocus in class JComponent
    • getMonthStrings

      protected static String[] getMonthStrings()
      DateFormatSymbols returns an extra, empty value at the end of the array of months. Remove it.