com.ibm.spinner
Class DateSpinner

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--com.ibm.spinner.SpinnerGUI
                                |
                                +--com.ibm.spinner.Spinner
                                      |
                                      +--com.ibm.spinner.CalendarSpinner
                                            |
                                            +--com.ibm.spinner.DateSpinner

public class DateSpinner
extends CalendarSpinner

A spinner which displays and spins date. The date value can be changed by clicking on different subfields and spinning on them. The user can also type in a date string to set the current value.


Inner classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Field Summary
static java.lang.String FULL
          One kind of date format string.
static java.lang.String LONG
          One kind of date format string.
static java.lang.String MEDIUM
          One kind of date format string.
static java.lang.String SHORT
          One kind of date format string.
 
Fields inherited from class com.ibm.spinner.CalendarSpinner
DATE, FULL, HOUR, LONG, MEDIUM, MINUTE, MONTH, SECOND, SHORT, YEAR
 
Fields inherited from class com.ibm.spinner.SpinnerGUI
SPIN_HORIZONTAL, SPIN_VERTICAL
 
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, 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
 
Constructor Summary
DateSpinner()
          Constructs a new date spinner with default setting.
 
Method Summary
 void setCaretPos(int newCaretPos)
          Sets the current caret positon of the text field.
 void setFormatString(java.lang.String newFormatString)
          Set the user defined pattern string for formatting and parsing date in a locale-sensitive manner.
 void setFormattingStyle(int newFormattingStyle)
          Sets the default formatting styles which can be FULL, LONG, MEDIUM, of SHORT.
 
Methods inherited from class com.ibm.spinner.CalendarSpinner
actionPerformed, addDateChangedListener, dateChanged, focusLost, getCalendar, getCaretPos, getDate, getDatePartValue, getDateString, getDay, getFormatString, getFormattingStyle, getHour, getMaximum, getMinimum, getMinute, getMonth, getSecond, getSQLDate, getTimePartValue, getTimeZone, getValue, getYear, isWrapAssociated, keyPressed, keyReleased, mouseReleased, removeDateChangedListener, scrollDown, scrollUp, setCalendar, setDate, setDateByFields, setDatePartValue, setDateString, setDay, setHour, setMaximum, setMinimum, setMinute, setMonth, setSecond, setTimePartValue, setTimeZone, setValue, setWrapAssociated, setYear
 
Methods inherited from class com.ibm.spinner.Spinner
addChangeListener, addSpinnerErrorEventListener, isWrap, removeChangeListener, removeSpinnerErrorEventListener, setWrap
 
Methods inherited from class com.ibm.spinner.SpinnerGUI
focusGained, getColumns, getDecrButtonArrowColor, getIncrButtonArrowColor, getMaximumSize, getMinimumSize, getOrientation, getPreferredSize, isEditable, isEnabled, keyTyped, mouseClicked, mouseEntered, mouseExited, mousePressed, setBackground, setColumns, setDecrButtonArrowColor, setEditable, setEnabled, setFont, setForeground, setIncrButtonArrowColor, setOpaque, setOrientation
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUIClassID, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInsets, getInsets, getLocation, getNextFocusableComponent, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setMaximumSize, setMinimumSize, setNextFocusableComponent, setPreferredSize, setRequestFocusEnabled, setToolTipText, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, remove, remove, removeAll, removeContainerListener, setLayout, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, bounds, checkImage, checkImage, contains, createImage, createImage, disable, dispatchEvent, enable, enable, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hide, imageUpdate, inside, isDisplayable, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FULL

public static final java.lang.String FULL
One kind of date format string.

LONG

public static final java.lang.String LONG
One kind of date format string.

MEDIUM

public static final java.lang.String MEDIUM
One kind of date format string.

SHORT

public static final java.lang.String SHORT
One kind of date format string.
Constructor Detail

DateSpinner

public DateSpinner()
Constructs a new date spinner with default setting.
Method Detail

setCaretPos

public void setCaretPos(int newCaretPos)
Sets the current caret positon of the text field.
Parameters:
newCaretPos - the sub-field number of the text
Overrides:
setCaretPos in class CalendarSpinner

setFormatString

public void setFormatString(java.lang.String newFormatString)
Set the user defined pattern string for formatting and parsing date in a locale-sensitive manner.
Parameters:
format - the new formatting string
Overrides:
setFormatString in class CalendarSpinner
See Also:
CalendarSpinner.getFormatString()

setFormattingStyle

public void setFormattingStyle(int newFormattingStyle)
Sets the default formatting styles which can be FULL, LONG, MEDIUM, of SHORT.
Parameters:
newFormattingStyle - the default formatting style.
Overrides:
setFormattingStyle in class CalendarSpinner