javax.swing

Class JSpinner.DateEditor

public static class JSpinner.DateEditor extends JSpinner.DefaultEditor

An editor class for a JSpinner that is used for displaying and editing dates (e.g. that uses SpinnerDateModel as model). The editor uses a {@link JTextField} with the value displayed by a {@link DateFormatter} instance.
Constructor Summary
DateEditor(JSpinner spinner)
Creates a new instance of DateEditor for the specified JSpinner.
DateEditor(JSpinner spinner, String dateFormatPattern)
Creates a new instance of DateEditor for the specified JSpinner using the specified date format pattern.
Method Summary
SimpleDateFormatgetFormat()
Returns the SimpleDateFormat instance that is used to format the date value.
SpinnerDateModelgetModel()
Returns the {@link SpinnerDateModel} that is edited by this editor.

Constructor Detail

DateEditor

public DateEditor(JSpinner spinner)
Creates a new instance of DateEditor for the specified JSpinner.

Parameters: spinner the JSpinner for which to create a DateEditor instance

DateEditor

public DateEditor(JSpinner spinner, String dateFormatPattern)
Creates a new instance of DateEditor for the specified JSpinner using the specified date format pattern.

Parameters: spinner the JSpinner for which to create a DateEditor instance dateFormatPattern the date format to use

See Also: SimpleDateFormat

Method Detail

getFormat

public SimpleDateFormat getFormat()
Returns the SimpleDateFormat instance that is used to format the date value.

Returns: the SimpleDateFormat instance that is used to format the date value

getModel

public SpinnerDateModel getModel()
Returns the {@link SpinnerDateModel} that is edited by this editor.

Returns: the SpinnerDateModel that is edited by this editor