Spec-Zone .ru
спецификации, руководства, описания, API
|
|
Java™ Platform Standard Ed. 7 DRAFT ea-b118 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JPanel javax.swing.JSpinner.DefaultEditor javax.swing.JSpinner.NumberEditor
public static class JSpinner.NumberEditor extends JSpinner.DefaultEditor
An editor for a JSpinner
whose model is a
SpinnerNumberModel
. The value of the editor is
displayed with a JFormattedTextField
whose format
is defined by a NumberFormatter
instance whose
minimum
and maximum
properties
are mapped to the SpinnerNumberModel
.
Modifier and Type | Class and Description |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Modifier and Type | Field and Description |
---|
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor and Description |
---|
JSpinner.NumberEditor(JSpinner spinner)
Construct a JSpinner editor that supports displaying
and editing the value of a SpinnerNumberModel
with a JFormattedTextField . |
JSpinner.NumberEditor(JSpinner spinner,
String decimalFormatPattern)
Construct a JSpinner editor that supports displaying
and editing the value of a SpinnerNumberModel
with a JFormattedTextField . |
Modifier and Type | Method and Description |
---|---|
DecimalFormat |
getFormat()
Returns the java.text.DecimalFormat object the
JFormattedTextField uses to parse and format
numbers. |
SpinnerNumberModel |
getModel()
Return our spinner ancestor's SpinnerNumberModel . |
Methods inherited from class javax.swing.JSpinner.DefaultEditor |
---|
addLayoutComponent, commitEdit, dismiss, getBaseline, getBaselineResizeBehavior, getSpinner, getTextField, layoutContainer, minimumLayoutSize, preferredLayoutSize, propertyChange, removeLayoutComponent, stateChanged |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public JSpinner.NumberEditor(JSpinner spinner)
JSpinner
editor that supports displaying
and editing the value of a SpinnerNumberModel
with a JFormattedTextField
. This
NumberEditor
becomes both a ChangeListener
on the spinner 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 SpinnerNumberModel
getModel()
,
getFormat()
,
SpinnerNumberModel
public JSpinner.NumberEditor(JSpinner spinner, String decimalFormatPattern)
JSpinner
editor that supports displaying
and editing the value of a SpinnerNumberModel
with a JFormattedTextField
. This
NumberEditor
becomes both a ChangeListener
on the spinner and a PropertyChangeListener
on the new JFormattedTextField
.
spinner
- the spinner whose model this
editor will monitordecimalFormatPattern
- the initial pattern for the
DecimalFormat
object that's used to display
and parse the value of the text field.IllegalArgumentException
- if the spinners model is not
an instance of SpinnerNumberModel
or if
decimalFormatPattern
is not a legal
argument to DecimalFormat
JSpinner.DefaultEditor.getTextField()
,
SpinnerNumberModel
,
DecimalFormat
Method Detail |
---|
public DecimalFormat getFormat()
java.text.DecimalFormat
object the
JFormattedTextField
uses to parse and format
numbers.
getTextField().getFormatter().getFormat()
.JSpinner.DefaultEditor.getTextField()
,
DecimalFormat
public SpinnerNumberModel getModel()
SpinnerNumberModel
.
getSpinner().getModel()
JSpinner.DefaultEditor.getSpinner()
,
JSpinner.DefaultEditor.getTextField()
|
Java™ Platform Standard Ed. 7 DRAFT ea-b118 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1993, 2010, Oracle Corporation. All rights reserved.