- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- javax.swing.JSpinner.DefaultEditor
-
- javax.swing.JSpinner.NumberEditor
-
- 实现的所有接口
-
ImageObserver
,LayoutManager
,MenuContainer
,PropertyChangeListener
,Serializable
,EventListener
,Accessible
,ChangeListener
- Enclosing class:
- JSpinner
public static class JSpinner.NumberEditor extends JSpinner.DefaultEditor
JSpinner
的编辑,其型号为SpinnerNumberModel
。 编辑器的值显示为JFormattedTextField
其格式由NumberFormatter
实例定义,其minimum
和maximum
属性映射到SpinnerNumberModel
。- 从以下版本开始:
- 1.4
- 另请参见:
- Serialized Form
-
-
嵌套类汇总
-
嵌套类/接口声明在类 javax.swing.JPanel
JPanel.AccessibleJPanel
-
嵌套类/接口声明在类 javax.swing.JComponent
JComponent.AccessibleJComponent
-
嵌套类/接口声明在类 java.awt.Container
Container.AccessibleAWTContainer
-
-
字段汇总
-
声明的属性在类 javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
-
声明的属性在类 java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
-
Fields declared in interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
-
-
构造方法摘要
构造方法 构造器 描述 NumberEditor(JSpinner spinner)
构造一个JSpinner
编辑器,支持显示和编辑的价值SpinnerNumberModel
与JFormattedTextField
。NumberEditor(JSpinner spinner, String decimalFormatPattern)
构造一个JSpinner
编辑器,支持显示和编辑的价值SpinnerNumberModel
与JFormattedTextField
。
-
方法摘要
所有方法 实例方法 具体的方法 变量和类型 方法 描述 DecimalFormat
getFormat()
返回JFormattedTextField
用于解析和格式化数字的java.text.DecimalFormat
对象。SpinnerNumberModel
getModel()
返回我们的旋转器祖先的SpinnerNumberModel
。-
声明方法的类 javax.swing.JSpinner.DefaultEditor
addLayoutComponent, commitEdit, dismiss, getBaseline, getBaselineResizeBehavior, getSpinner, getTextField, layoutContainer, minimumLayoutSize, preferredLayoutSize, propertyChange, removeLayoutComponent, stateChanged
-
声明方法的类 javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
-
声明方法的类 javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
-
声明方法的类 java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
-
声明方法的类 java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
构造方法详细信息
-
NumberEditor
public NumberEditor(JSpinner spinner)
构造一个JSpinner
编辑器,支持显示和编辑的价值SpinnerNumberModel
与JFormattedTextField
。This
NumberEditor
既是一种ChangeListener
微调器和PropertyChangeListener
在新JFormattedTextField
。- 参数
-
spinner
- 模型this
编辑器将监视的微调器 - 异常
-
IllegalArgumentException
- 如果微调器模型不是SpinnerNumberModel
的实例 - 另请参见:
-
getModel()
,getFormat()
,SpinnerNumberModel
-
NumberEditor
public NumberEditor(JSpinner spinner, String decimalFormatPattern)
构造一个JSpinner
编辑器,支持显示和编辑的价值SpinnerNumberModel
与JFormattedTextField
。This
NumberEditor
既是一种ChangeListener
微调器和PropertyChangeListener
在新JFormattedTextField
。- 参数
-
spinner
- 模型this
编辑器将监视的微调器 -
decimalFormatPattern
- 用于显示和解析文本字段值的DecimalFormat
对象的初始模式。 - 异常
-
IllegalArgumentException
-如果微调器模型不是一个实例SpinnerNumberModel
或者decimalFormatPattern
不是一个法律论据DecimalFormat
- 另请参见:
-
JSpinner.DefaultEditor.getTextField()
,SpinnerNumberModel
,DecimalFormat
-
-
方法详细信息
-
getFormat
public DecimalFormat getFormat()
返回JFormattedTextField
用于解析和格式化数字的java.text.DecimalFormat
对象。- 结果
-
值
getTextField().getFormatter().getFormat()
。 - 另请参见:
-
JSpinner.DefaultEditor.getTextField()
,DecimalFormat
-
getModel
public SpinnerNumberModel getModel()
返回我们的微调器祖先的SpinnerNumberModel
。- 结果
-
getSpinner().getModel()
- 另请参见:
-
JSpinner.DefaultEditor.getSpinner()
,JSpinner.DefaultEditor.getTextField()
-
-