com.nonesole.swing.plaf.basic.table.utable.textfield
类 UDecimalTextField

java.lang.Object
  继承者 java.awt.Component
      继承者 java.awt.Container
          继承者 javax.swing.JComponent
              继承者 javax.swing.text.JTextComponent
                  继承者 javax.swing.JTextField
                      继承者 com.nonesole.swing.plaf.basic.table.utable.textfield.UAbstractNumberTextField
                          继承者 com.nonesole.swing.plaf.basic.table.utable.textfield.UDoubleTextField
                              继承者 com.nonesole.swing.plaf.basic.table.utable.textfield.UDecimalTextField
所有已实现的接口:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.Scrollable, javax.swing.SwingConstants

public class UDecimalTextField
extends UDoubleTextField

可以指定小数位数的控件

版本:
1.0 - build in 2009-11-06
作者:
JACK LEE
另请参见:
序列化表格

嵌套类摘要
 
从类 javax.swing.JTextField 继承的嵌套类/接口
javax.swing.JTextField.AccessibleJTextField
 
从类 javax.swing.text.JTextComponent 继承的嵌套类/接口
javax.swing.text.JTextComponent.AccessibleJTextComponent, javax.swing.text.JTextComponent.KeyBinding
 
从类 javax.swing.JComponent 继承的嵌套类/接口
javax.swing.JComponent.AccessibleJComponent
 
从类 java.awt.Container 继承的嵌套类/接口
java.awt.Container.AccessibleAWTContainer
 
从类 java.awt.Component 继承的嵌套类/接口
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
字段摘要
protected static double doubleMaxValue
           
 
从类 javax.swing.JTextField 继承的字段
notifyAction
 
从类 javax.swing.text.JTextComponent 继承的字段
DEFAULT_KEYMAP, FOCUS_ACCELERATOR_KEY
 
从类 javax.swing.JComponent 继承的字段
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
从类 java.awt.Component 继承的字段
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
从接口 javax.swing.SwingConstants 继承的字段
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
 
从接口 java.awt.image.ImageObserver 继承的字段
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
构造函数摘要
UDecimalTextField(int maximumFractionDigits)
          指定小数位数的控件
 
方法摘要
protected  void addSeparator()
          增加整数部分的分隔符
protected  void arrangeNumber()
          整理数据,即按照指定格式重新整理一下数据并显示出来
protected  void backSpaceKeyAction()
          取消键
protected  void deleteKeyAction()
          删除键
 java.lang.String formatNumber(double n)
          根据参数double的类型返回相应的数字格式。
 boolean isUseSeparator()
          是否使用整数分割符,即"100,000"
protected  void numberKeyAction(java.lang.String num)
          数字键
protected  void periodKeyAction()
          小数点按键
 UDecimalTextField setUseSeparator(boolean useSeparator)
          设置是否使用整数分割符,即"100,000"
 UDecimalTextField setValue(double obj)
          写入值
 
从类 com.nonesole.swing.plaf.basic.table.utable.textfield.UDoubleTextField 继承的方法
getValue, isKeyEventValid, keyPressedAction, processKeyBinding, setDefaultValue
 
从类 com.nonesole.swing.plaf.basic.table.utable.textfield.UAbstractNumberTextField 继承的方法
keyReleasedAction, keyTypedAction, leftKeyAction, minusKeyAction, processKeyEvent, rightKeyAction
 
从类 javax.swing.JTextField 继承的方法
addActionListener, configurePropertiesFromAction, createActionPropertyChangeListener, createDefaultModel, fireActionPerformed, getAccessibleContext, getAction, getActionListeners, getActions, getColumns, getColumnWidth, getHorizontalAlignment, getHorizontalVisibility, getPreferredSize, getScrollOffset, getUIClassID, isValidateRoot, paramString, postActionEvent, removeActionListener, scrollRectToVisible, setAction, setActionCommand, setColumns, setDocument, setFont, setHorizontalAlignment, setScrollOffset
 
从类 javax.swing.text.JTextComponent 继承的方法
addCaretListener, addInputMethodListener, addKeymap, copy, cut, fireCaretUpdate, getCaret, getCaretColor, getCaretListeners, getCaretPosition, getDisabledTextColor, getDocument, getDragEnabled, getFocusAccelerator, getHighlighter, getInputMethodRequests, getKeymap, getKeymap, getMargin, getNavigationFilter, getPreferredScrollableViewportSize, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectedText, getSelectedTextColor, getSelectionColor, getSelectionEnd, getSelectionStart, getText, getText, getToolTipText, getUI, isEditable, loadKeymap, modelToView, moveCaretPosition, paste, processInputMethodEvent, read, removeCaretListener, removeKeymap, removeNotify, replaceSelection, select, selectAll, setCaret, setCaretColor, setCaretPosition, setComponentOrientation, setDisabledTextColor, setDragEnabled, setEditable, setFocusAccelerator, setHighlighter, setKeymap, setMargin, setNavigationFilter, setSelectedTextColor, setSelectionColor, setSelectionEnd, setSelectionStart, setText, setUI, updateUI, viewToModel, write
 
从类 javax.swing.JComponent 继承的方法
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, 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, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, 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, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
从类 java.awt.Component 继承的方法
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, 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, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

字段详细信息

doubleMaxValue

protected static final double doubleMaxValue
另请参见:
常量字段值
构造函数详细信息

UDecimalTextField

public UDecimalTextField(int maximumFractionDigits)
指定小数位数的控件

参数:
decimalbit - 小数的位数
方法详细信息

periodKeyAction

protected void periodKeyAction()
小数点按键

覆盖:
UDoubleTextField 中的 periodKeyAction

numberKeyAction

protected void numberKeyAction(java.lang.String num)
数字键

覆盖:
UDoubleTextField 中的 numberKeyAction

addSeparator

protected void addSeparator()
增加整数部分的分隔符


formatNumber

public java.lang.String formatNumber(double n)
根据参数double的类型返回相应的数字格式。最多保留两位小数, 最少保留一位小数。
最大值不超过99,999,999,999,999.98。

参数:
n -
返回:
格式化好的数字

isUseSeparator

public boolean isUseSeparator()
是否使用整数分割符,即"100,000"

返回:
true - 表示使用,false - 表示不使用

setUseSeparator

public UDecimalTextField setUseSeparator(boolean useSeparator)
设置是否使用整数分割符,即"100,000"

参数:
true - - 表示使用,false - 表示不使用

arrangeNumber

protected void arrangeNumber()
整理数据,即按照指定格式重新整理一下数据并显示出来


setValue

public UDecimalTextField setValue(double obj)
写入值

覆盖:
UDoubleTextField 中的 setValue
参数:
obj - - double对象
返回:
UDoubleTextField对象

backSpaceKeyAction

protected void backSpaceKeyAction()
取消键

覆盖:
UAbstractNumberTextField 中的 backSpaceKeyAction

deleteKeyAction

protected void deleteKeyAction()
删除键

覆盖:
UAbstractNumberTextField 中的 deleteKeyAction