public static class JSpinner.DateEditor extends JSpinner.DefaultEditor
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
.
JPanel.AccessibleJPanel
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
public 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
.
spinner
- the spinner whose model this
editor will monitorIllegalArgumentException
- if the spinners model is not an instance of SpinnerDateModel
getModel()
, getFormat()
, SpinnerDateModel
public 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
.
spinner
- the spinner whose model this
editor will monitordateFormatPattern
- the initial pattern for the SimpleDateFormat
object that's used to display and parse the value of the text field.IllegalArgumentException
- if the spinners model is not an instance of SpinnerDateModel
getModel()
, getFormat()
, SpinnerDateModel
, SimpleDateFormat
public SimpleDateFormat getFormat()
Returns the java.text.SimpleDateFormat
object the JFormattedTextField
uses to parse and format numbers.
getTextField().getFormatter().getFormat()
.JSpinner.DefaultEditor.getTextField()
, SimpleDateFormat
public SpinnerDateModel getModel()
Return our spinner ancestor's SpinnerDateModel
.
getSpinner().getModel()
JSpinner.DefaultEditor.getSpinner()
, JSpinner.DefaultEditor.getTextField()
© 1993–2017, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.