public static class

JSpinner.DateEditor

extends JSpinner.DefaultEditor
java.lang.Object
   ↳ java.awt.Component
     ↳ java.awt.Container
       ↳ javax.swing.JComponent
         ↳ javax.swing.JPanel
           ↳ javax.swing.JSpinner.DefaultEditor
             ↳ javax.swing.JSpinner.DateEditor

Class Overview

An editor for a JSpinner whose model is a SpinnerDateModel. The value of the editor is displayed with a JFormattedTextField whose format is defined by a DateFormatter instance whose minimum and maximum properties are mapped to the SpinnerDateModel.

Summary

[Expand]
Inherited Constants
From class javax.swing.JComponent
From class java.awt.Component
From interface java.awt.image.ImageObserver
[Expand]
Inherited Fields
From class javax.swing.JComponent
Public Constructors
JSpinner.DateEditor(JSpinner spinner)
Construct a JSpinner editor that supports displaying and editing the value of a SpinnerDateModel with a JFormattedTextField.
JSpinner.DateEditor(JSpinner spinner, String dateFormatPattern)
Construct a JSpinner editor that supports displaying and editing the value of a SpinnerDateModel with a JFormattedTextField.
Public Methods
SimpleDateFormat getFormat()
Returns the java.text.SimpleDateFormat object the JFormattedTextField uses to parse and format numbers.
SpinnerDateModel getModel()
Return our spinner ancestor's SpinnerDateModel.
[Expand]
Inherited Methods
From class javax.swing.JSpinner.DefaultEditor
From class javax.swing.JPanel
From class javax.swing.JComponent
From class java.awt.Container
From class java.awt.Component
From class java.lang.Object
From interface java.awt.LayoutManager
From interface java.awt.MenuContainer
From interface java.awt.image.ImageObserver
From interface java.beans.PropertyChangeListener
From interface javax.accessibility.Accessible
From interface javax.swing.event.ChangeListener

Public Constructors

public JSpinner.DateEditor (JSpinner spinner)

Construct a JSpinner editor that supports displaying and editing the value of a SpinnerDateModel with a JFormattedTextField. This DateEditor becomes both a ChangeListener on the spinners model and a PropertyChangeListener on the new JFormattedTextField.

Parameters
spinner the spinner whose model this editor will monitor
Throws
IllegalArgumentException if the spinners model is not an instance of SpinnerDateModel

public JSpinner.DateEditor (JSpinner spinner, String dateFormatPattern)

Construct a JSpinner editor that supports displaying and editing the value of a SpinnerDateModel with a JFormattedTextField. This DateEditor becomes both a ChangeListener on the spinner and a PropertyChangeListener on the new JFormattedTextField.

Parameters
spinner the spinner whose model this editor will monitor
dateFormatPattern the initial pattern for the SimpleDateFormat object that's used to display and parse the value of the text field.
Throws
IllegalArgumentException if the spinners model is not an instance of SpinnerDateModel

Public Methods

public SimpleDateFormat getFormat ()

Returns the java.text.SimpleDateFormat object the JFormattedTextField uses to parse and format numbers.

Returns
  • the value of getTextField().getFormatter().getFormat().

public SpinnerDateModel getModel ()

Return our spinner ancestor's SpinnerDateModel.

Returns
  • getSpinner().getModel()