com.ibm.spinner
Class CalendarSpinner

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
Direct Known Subclasses:
DateSpinner, TimeSpinner

public class CalendarSpinner
extends Spinner
implements DateChangedListener

A spinner which displays and spins date/time. The date/time 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.

See Also:
Serialized Form

Inner classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Field Summary
static int AM_PM
          One kind of caret position.
static int AMPM
          One kind of caret position.
static int DATE
          One kind of caret position.
static int DAY_OF_MONTH
          One kind of caret position.
static int DAY_OF_WEEK
          One kind of caret position.
static int DAY_OF_WEEK_IN_MONTH
          One kind of caret position.
static int DAY_OF_YEAR
          One kind of caret position.
static int ERA
          One kind of caret position.
static int HOUR
          One kind of caret position.
static int HOUR_OF_DAY
          One kind of caret position.
static int MILLISECOND
          One kind of caret position.
static int MINUTE
          One kind of caret position.
static int MONTH
          One kind of caret position.
static int SECOND
          One kind of caret position.
static int WEEK_OF_MONTH
          One kind of caret position.
static int WEEK_OF_YEAR
          One kind of caret position.
static int YEAR
          One kind of caret position.
 
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
CalendarSpinner()
          Default constructor which constructs a CalendarSpinner with the time zone set to that of the host, and the formatString property set to the default locale's Dateformat.
 
Method Summary
 void addDateChangedListener(DateChangedListener listener)
          Adds a DateChangedListener.
 void changeFormatStyle(int iFormatStyle, java.lang.String sNewFormatString)
          Changes any existed formatting string
 void dateChanged(DateChangedEvent e)
          Event method of DateChangedListener.
 void focusGained(java.awt.event.FocusEvent e)
          Invoked when a component gains the keyboard focus
 void focusLost(java.awt.event.FocusEvent e)
          Invoked when a component loses the keyboard focus
 java.lang.String getAboutThisBean()
          Returns a special formatted string intended for use by the editor of this property.
 java.awt.Color getBackground()
          Gets the background color
 java.util.Calendar getCalendar()
          Gets the current calendar
 int getCaretPos()
          Gets the current caret positon field of the spinner.
 java.util.Date getDate()
          Gets the current date/time stored in the spinner.
 long getDatePartValue()
          Gets the current date part(year, month, day).
 java.lang.String getDateString()
          Gets the current date/time string shown in the entry field.
 int getDay()
          Gets the current day.
 java.awt.Font getFont()
          Returns the font
 java.awt.Color getForeground()
          Returns the textfield foreground color
 java.lang.String getFormatString()
          Gets the current date/time format string.
 java.lang.String getFormatStringByStyle(int iFormatStyle)
          Gets date/time format string by its style.
 FormatStrings getFormatStrings()
          Gets FormatStrings class for the spinner, containing all the format strings This method is intended to be used during Designtime.
 int getFormattingStyle()
          Gets the default formatting styles which can be FULL, LONG, MEDIUM, or SHORT.
 int getHour()
          Gets the current hour.
 java.util.Locale getLocale()
          Overriden from java.awt.Component to catch IllegalComponentStateException.
 java.util.Calendar getMaximum()
          Gets the maximum property of calendar.
 java.util.Calendar getMinimum()
          Gets the minimum property of calendar.
 int getMinute()
          Gets the current minute.
 int getMonth()
          Gets the current month.
 int getSecond()
          Gets the current second.
 java.sql.Date getSQLDate()
          Returns the spinner's current date as an SQL date.
 long getTimePartValue()
          Gets the current time part(hour, minute, second).
 java.lang.String getTimeZone()
          Returns the ID of the spinner's current time zone.
 long getValue()
          Gets the current date/time value.
 int getYear()
          Gets the current year.
 void initFormatStyle(int iStyle)
          This method is used for initializing the formatting style via IDE.
 void initMaximum(java.util.Calendar newMaximumCalendar)
          Initializes the maximum property of calendar.
 void initMinimum(java.util.Calendar newMinimumCalendar)
          Initializes the minimum property of calendar.
 boolean isEditable()
          Indicates whether or not this text component is editable.
 boolean isEnabled()
          Determines whether this component is enabled.
 boolean isOpaque()
          Returns true if this component is completely opaque.
 boolean isSpinnable()
          Indicates whether or not this text component is spinnable, ineffective in the non-editable mode.
 boolean isValidateMonthFirst()
          Returns true if the validating of month performing correcting day value.
 boolean isWrapAssociated()
          Returns true if the spinner's subfields can be wrapped together.
 void keyPressed(java.awt.event.KeyEvent e)
          Event method of KeyListener.
 void keyTyped(java.awt.event.KeyEvent e)
          Event method of KeyListener.
 void mousePressed(java.awt.event.MouseEvent e)
          Event method of MouseListener.
 void removeDateChangedListener(DateChangedListener listener)
          Removes a date-changed listener.
 void scrollDown()
          Decrements the date/time subfield that the caret points to.
 void scrollUp()
          Increments the date/time subfield that the caret points to.
 void setAboutThisBean(java.lang.String aboutThisBean)
          Setter method for the aboutThisBean property to be available in the properties list.
 void setBackground(java.awt.Color c)
          Sets the background color of this component.
 void setCalendar(java.util.Calendar newCalendar)
          Sets the current calendar's six time fields ,which are year, month, date, hour, minute, second the same with the time fields of another calendar.
 void setCaretPos(int newCaretPos)
          Sets the current caret positon of the text field.
 void setDate(java.util.Date date)
          Sets the current date/time.
 void setDateByFields(int year, int month, int day, int hour, int minute, int second)
          Sets the current date/time by time fields.
 void setDatePartValue(long newValue)
          Sets the current date part(year, month, day) by by fields.
 void setDateString(java.lang.String str)
          Sets the current date/time shown in the entry field.
 void setDay(int newDays)
          Sets the current date.
 void setEditable(boolean aBoolean)
          Sets whether text editing is enabled.
 void setEnabled(boolean b)
          Enables or disables this component, depending on the value of the parameter b.
 void setFont(java.awt.Font f)
          Sets the font of this component.
 void setForeground(java.awt.Color c)
          Sets the foreground color of this component.
 void setFormatString(java.lang.String newFormatString)
          Sets the user defined pattern string for formatting and parsing date/time in a locale-sensitive manner.
 void setFormatStrings(FormatStrings aFS)
          Sets the user defined pattern strings for formatting and parsing date/time in a locale-sensitive manner.
 void setFormattingStyle(int iNewFormattingStyle)
          Sets the default formatting styles which can be FULL, LONG, MEDIUM, of SHORT.
 void setHour(int newHours)
          Sets the current hour.
 void setLocale(java.util.Locale newLocale)
          Overriden form java.awt.Component Sets the locale property (java.util.Locale) value.
 void setMaximum(java.util.Calendar newMaximumCalendar)
          Sets the maximum property of calendar.
 void setMinimum(java.util.Calendar newMinimumCalendar)
          Sets the minimum property of calendar.
 void setMinute(int newMinutes)
          Sets the current minute.
 void setMonth(int newMonths)
          Sets the current month.
 void setSecond(int newSeconds)
          Sets the current second.
 void setSpinnable(boolean aBoolean)
          Sets whether text spinning is enabled, ineffective in the non-editable mode.
 void setTimePartValue(long newValue)
          Sets the current time part(hour, minute, second) by fields.
 void setTimeZone(java.lang.String id)
          Sets the time zone used by the DateFormat class for formatting strings into days.
 void setValidateMonthFirst(boolean validateMonthFirst)
          Sets whether month or day must be validated first.
 void setValue(long newValue)
          Sets the current date/time value.
 void setWrapAssociated(boolean b)
          Sets whether the spinner's subfields can be wrapped together or not.
 void setYear(int newYears)
          Sets the current year.
 void stateChanged(javax.swing.event.ChangeEvent event)
          Event method of ChangedListener
 
Methods inherited from class com.ibm.spinner.Spinner
addChangeListener, addSpinnerErrorEventListener, isWrap, removeChangeListener, removeSpinnerErrorEventListener, setWrap
 
Methods inherited from class com.ibm.spinner.SpinnerGUI
getColumns, getDecrButtonArrowColor, getEditable, getIncrButtonArrowColor, getMaximumSize, getMinimumSize, getOrientation, getPreferredSize, keyReleased, mouseClicked, mouseEntered, mouseExited, mouseReleased, setColumns, setDecrButtonArrowColor, setIncrButtonArrowColor, setOpaque, setOrientation, setToolTipText
 
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, 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, 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, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFontMetrics, getInputContext, getInputMethodRequests, 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, 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

ERA

public static final int ERA
One kind of caret position.

YEAR

public static final int YEAR
One kind of caret position.

MONTH

public static final int MONTH
One kind of caret position.

WEEK_OF_YEAR

public static final int WEEK_OF_YEAR
One kind of caret position.

WEEK_OF_MONTH

public static final int WEEK_OF_MONTH
One kind of caret position.

DATE

public static final int DATE
One kind of caret position.

DAY_OF_MONTH

public static final int DAY_OF_MONTH
One kind of caret position.

DAY_OF_YEAR

public static final int DAY_OF_YEAR
One kind of caret position.

DAY_OF_WEEK

public static final int DAY_OF_WEEK
One kind of caret position.

DAY_OF_WEEK_IN_MONTH

public static final int DAY_OF_WEEK_IN_MONTH
One kind of caret position.

AMPM

public static final int AMPM
One kind of caret position.

AM_PM

public static final int AM_PM
One kind of caret position.

HOUR

public static final int HOUR
One kind of caret position.

HOUR_OF_DAY

public static final int HOUR_OF_DAY
One kind of caret position.

MINUTE

public static final int MINUTE
One kind of caret position.

SECOND

public static final int SECOND
One kind of caret position.

MILLISECOND

public static final int MILLISECOND
One kind of caret position.
Constructor Detail

CalendarSpinner

public CalendarSpinner()
Default constructor which constructs a CalendarSpinner with the time zone set to that of the host, and the formatString property set to the default locale's Dateformat.
Method Detail

addDateChangedListener

public void addDateChangedListener(DateChangedListener listener)
Adds a DateChangedListener.
Parameters:
listener - The listener to add.

changeFormatStyle

public void changeFormatStyle(int iFormatStyle,
                              java.lang.String sNewFormatString)
Changes any existed formatting string
Parameters:
iFormatStyle - int
sNewFormatString - java.lang.String

dateChanged

public void dateChanged(DateChangedEvent e)
Event method of DateChangedListener.
Specified by:
dateChanged in interface DateChangedListener
Parameters:
e - DateChangedEvent

focusGained

public void focusGained(java.awt.event.FocusEvent e)
Invoked when a component gains the keyboard focus
Parameters:
e - FocusEvent
Overrides:
focusGained in class SpinnerGUI

focusLost

public void focusLost(java.awt.event.FocusEvent e)
Invoked when a component loses the keyboard focus
Parameters:
e - FocusEvent
Overrides:
focusLost in class SpinnerGUI

getAboutThisBean

public java.lang.String getAboutThisBean()
Returns a special formatted string intended for use by the editor of this property.
Returns:
the special formatted string for use by the editor of this property

getBackground

public java.awt.Color getBackground()
Gets the background color
Returns:
java.awt.Color
Overrides:
getBackground in class java.awt.Component

getCalendar

public java.util.Calendar getCalendar()
Gets the current calendar
Returns:
The calendar of the current CalendarSpinner.

getCaretPos

public int getCaretPos()
Gets the current caret positon field of the spinner.
Returns:
The caret position

getDate

public java.util.Date getDate()
Gets the current date/time stored in the spinner.
Returns:
an instance of java.util.Date that represents the date/time stored by this spinner

getDatePartValue

public long getDatePartValue()
Gets the current date part(year, month, day).
Returns:
The date part value as a long.

getDateString

public java.lang.String getDateString()
Gets the current date/time string shown in the entry field.
Returns:
The current date/time string.

getDay

public int getDay()
Gets the current day.
Returns:
The current day as an int.

getFont

public java.awt.Font getFont()
Returns the font
Returns:
java.awt.Font
Overrides:
getFont in class java.awt.Component

getForeground

public java.awt.Color getForeground()
Returns the textfield foreground color
Returns:
java.awt.Color
Overrides:
getForeground in class java.awt.Component

getFormatString

public java.lang.String getFormatString()
Gets the current date/time format string.
Returns:
The current format string.

getFormatStringByStyle

public java.lang.String getFormatStringByStyle(int iFormatStyle)
Gets date/time format string by its style.
Parameters:
iFormatStyle - int Style of the format string
Returns:
The current format string.

getFormatStrings

public FormatStrings getFormatStrings()
Gets FormatStrings class for the spinner, containing all the format strings This method is intended to be used during Designtime.
Returns:
FormatStrings class

getFormattingStyle

public int getFormattingStyle()
Gets the default formatting styles which can be FULL, LONG, MEDIUM, or SHORT.
Returns:
an integer representing of the default formatting styles

getHour

public int getHour()
Gets the current hour.
Returns:
hours The hour as an int.

getLocale

public java.util.Locale getLocale()
Overriden from java.awt.Component to catch IllegalComponentStateException. Method returns default locale if it or its parent has no defined locale.
Returns:
This component's locale. If this component and parent component don't have a locale, default locale is returned.
Overrides:
getLocale in class java.awt.Component
Since:
JDK1.1
See Also:
setLocale(java.util.Locale)

getMaximum

public java.util.Calendar getMaximum()
Gets the maximum property of calendar.
Returns:
The maximum as a Calendar.

getMinimum

public java.util.Calendar getMinimum()
Gets the minimum property of calendar.
Returns:
The minimum as a Calendar.

getMinute

public int getMinute()
Gets the current minute.
Returns:
minutes The minute as an int.

getMonth

public int getMonth()
Gets the current month.
Returns:
The current month as an int.

getSecond

public int getSecond()
Gets the current second.
Returns:
The second as an int.

getSQLDate

public java.sql.Date getSQLDate()
Returns the spinner's current date as an SQL date.
Returns:
an instance of java.sql.Date that represents the date stored by the spinner.

getTimePartValue

public long getTimePartValue()
Gets the current time part(hour, minute, second).
Returns:
The time part value as a long.

getTimeZone

public java.lang.String getTimeZone()
Returns the ID of the spinner's current time zone.
Returns:
The ID of current time zone

getValue

public long getValue()
Gets the current date/time value.
Returns:
current value as a long.

getYear

public int getYear()
Gets the current year.
Returns:
The current year as an int.

initFormatStyle

public void initFormatStyle(int iStyle)
This method is used for initializing the formatting style via IDE. Don't use it for programming!
Parameters:
iStyle - int

initMaximum

public void initMaximum(java.util.Calendar newMaximumCalendar)
Initializes the maximum property of calendar. If its value is before minimum, the minimum property is set to be equal the maximum.
Parameters:
newMaximumCalendar - The maximum as a Calendar.

initMinimum

public void initMinimum(java.util.Calendar newMinimumCalendar)
Initializes the minimum property of calendar. If its value is before maximum, the maximum property is set to be equal the minimum.
Parameters:
newMinimumCalendar - The minimum as a Calendar.

isEditable

public boolean isEditable()
Indicates whether or not this text component is editable.
Returns:
true if this text component is editable; false otherwise.
Overrides:
isEditable in class SpinnerGUI
Since:
JDK1ble
See Also:
setEditable(boolean)

isEnabled

public boolean isEnabled()
Determines whether this component is enabled. An enabled component can respond to user input and generate events. Components are enabled initially by default. A component may be enabled or disabled by calling its setEnabled method.
Returns:
true if the component is enabled; false otherwise.
Overrides:
isEnabled in class SpinnerGUI
Since:
JDK1.0
See Also:
setEnabled(boolean)

isOpaque

public boolean isOpaque()
Returns true if this component is completely opaque.

An opaque component paints every pixel within its rectangular region. A non-opaque component paints only some of its pixels, allowing the pixels underneath it to "show through". A component that does not fully paint its pixels therefore provides a degree of transparency.

Subclasses that guarantee to always completely paint their contents should override this method and return true.

This method will migrate to java.awt.Component in the next major JDK release

Returns:
true if this component is completely opaque.
Overrides:
isOpaque in class javax.swing.JComponent
See Also:
SpinnerGUI.setOpaque(boolean)

isSpinnable

public boolean isSpinnable()
Indicates whether or not this text component is spinnable, ineffective in the non-editable mode.
Returns:
true if this text component is spinnable; false otherwise.
Overrides:
isSpinnable in class SpinnerGUI
Since:
JDK1ble
See Also:
setSpinnable(boolean)

isValidateMonthFirst

public boolean isValidateMonthFirst()
Returns true if the validating of month performing correcting day value.
Returns:
if the validateMonthFirst true, the day will be corrected if it overflow maximum value for month. Otherwise month be corrected to previous value.
See Also:
setValidateMonthFirst(boolean)

isWrapAssociated

public boolean isWrapAssociated()
Returns true if the spinner's subfields can be wrapped together.
Returns:
if the wrapAssociated is true, the subfields can be wrapped together.

keyPressed

public void keyPressed(java.awt.event.KeyEvent e)
Event method of KeyListener.
Parameters:
e - KeyEvent
Overrides:
keyPressed in class Spinner

keyTyped

public void keyTyped(java.awt.event.KeyEvent e)
Event method of KeyListener.
Parameters:
e - KeyEvent
Overrides:
keyTyped in class SpinnerGUI

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Event method of MouseListener.
Parameters:
e - MouseEvent
Overrides:
mousePressed in class SpinnerGUI

removeDateChangedListener

public void removeDateChangedListener(DateChangedListener listener)
Removes a date-changed listener.
Parameters:
listener - The listener to remove.

scrollDown

public void scrollDown()
Decrements the date/time subfield that the caret points to.
Overrides:
scrollDown in class SpinnerGUI

scrollUp

public void scrollUp()
Increments the date/time subfield that the caret points to.
Overrides:
scrollUp in class SpinnerGUI

setAboutThisBean

public void setAboutThisBean(java.lang.String aboutThisBean)
Setter method for the aboutThisBean property to be available in the properties list. This method should not be used to set the aboutThisBean preperty value.
Parameters:
newValue - the special formatted string

setBackground

public void setBackground(java.awt.Color c)
Sets the background color of this component.
Parameters:
c - The color to become this component's background color.
Overrides:
setBackground in class SpinnerGUI
Since:
JDK1.0
See Also:
getBackground()

setCalendar

public void setCalendar(java.util.Calendar newCalendar)
Sets the current calendar's six time fields ,which are year, month, date, hour, minute, second the same with the time fields of another calendar. But the timeZone of the current calendar is not changed.
Parameters:
newCalendar - the calendar whose time fields will be used to change the current one.
Throws:
java.lang.IllegalArgumentException - exception

setCaretPos

public void setCaretPos(int newCaretPos)
Sets the current caret positon of the text field.
Parameters:
newCaretPos - the sub-field number of the text. Must be a Calendar constant (i.e. Calendar.YEAR)

setDate

public void setDate(java.util.Date date)
Sets the current date/time.
Parameters:
date - the new date/time.

setDateByFields

public void setDateByFields(int year,
                            int month,
                            int day,
                            int hour,
                            int minute,
                            int second)
Sets the current date/time by time fields.
Parameters:
year - The year as an int.
month - The month as an int. Month values are 0-11, e.g. 0 for January, 11 for December.
day - The day as an int.
hour - The hour as an int.
minute - The minute as an int.
second - The second as an int.

setDatePartValue

public void setDatePartValue(long newValue)
Sets the current date part(year, month, day) by by fields.
Parameters:
newValue - The date part value as a long.

setDateString

public void setDateString(java.lang.String str)
Sets the current date/time shown in the entry field.
Parameters:
str - The new date/time string.

setDay

public void setDay(int newDays)
Sets the current date.
Parameters:
newDays - The date as an int.

setEditable

public void setEditable(boolean aBoolean)
Sets whether text editing is enabled.
Parameters:
aBoolean - boolean
Overrides:
setEditable in class SpinnerGUI

setEnabled

public void setEnabled(boolean b)
Enables or disables this component, depending on the value of the parameter b. An enabled component can respond to user input and generate events. Components are enabled initially by default.
Parameters:
b - If true, this component is enabled; otherwise this component is disabled.
Overrides:
setEnabled in class SpinnerGUI
Since:
JDK1.1
See Also:
isEnabled()

setFont

public void setFont(java.awt.Font f)
Sets the font of this component.
Parameters:
f - The font to become this component's font.
Overrides:
setFont in class SpinnerGUI
Since:
JDK1.0
See Also:
getFont()

setForeground

public void setForeground(java.awt.Color c)
Sets the foreground color of this component.
Parameters:
c - The color to become this component's foreground color.
Overrides:
setForeground in class SpinnerGUI
Since:
JDK1.0
See Also:
getForeground()

setFormatString

public void setFormatString(java.lang.String newFormatString)
Sets the user defined pattern string for formatting and parsing date/time in a locale-sensitive manner.
Parameters:
newFormatString - the new formatting string.

setFormatStrings

public void setFormatStrings(FormatStrings aFS)
Sets the user defined pattern strings for formatting and parsing date/time in a locale-sensitive manner. This method is intended to be used during Designtime.
Parameters:
aFS - FormatStrings FormatStrings class, containing formatting strings and active style

setFormattingStyle

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

setHour

public void setHour(int newHours)
Sets the current hour.
Parameters:
newHours - The hour as an int.

setLocale

public void setLocale(java.util.Locale newLocale)
Overriden form java.awt.Component Sets the locale property (java.util.Locale) value.
Parameters:
locale - The new value for the property.
Overrides:
setLocale in class java.awt.Component
See Also:
getLocale()

setMaximum

public void setMaximum(java.util.Calendar newMaximumCalendar)
Sets the maximum property of calendar.
Parameters:
newMaximumCalendar - The maximum as a Calendar.

setMinimum

public void setMinimum(java.util.Calendar newMinimumCalendar)
Sets the minimum property of calendar.
Parameters:
newMinimum - The minimum as a Calendar.

setMinute

public void setMinute(int newMinutes)
Sets the current minute.
Parameters:
newMinutes - The minute as an int.

setMonth

public void setMonth(int newMonths)
Sets the current month.
Parameters:
newMonths - The month values are 0-11, e.g 0 for January, 11 for December.

setSecond

public void setSecond(int newSeconds)
Sets the current second.
Parameters:
newSeconds - The second as an int.

setSpinnable

public void setSpinnable(boolean aBoolean)
Sets whether text spinning is enabled, ineffective in the non-editable mode.
Parameters:
aBoolean - boolean
Overrides:
setSpinnable in class SpinnerGUI

setTimePartValue

public void setTimePartValue(long newValue)
Sets the current time part(hour, minute, second) by fields.
Parameters:
newValue - The time part value as a long.

setTimeZone

public void setTimeZone(java.lang.String id)
Sets the time zone used by the DateFormat class for formatting strings into days.
Parameters:
id - A time zone ID. For instance, the time zone ID for the Pacific Standard Time zone is "PST".

setValidateMonthFirst

public void setValidateMonthFirst(boolean validateMonthFirst)
Sets whether month or day must be validated first.
Parameters:
if - validateMonthFirst true, month will be validated first.
See Also:
isValidateMonthFirst()

setValue

public void setValue(long newValue)
Sets the current date/time value.
Parameters:
newValue - The new date/time value as a long.

setWrapAssociated

public void setWrapAssociated(boolean b)
Sets whether the spinner's subfields can be wrapped together or not.
Parameters:
b - if true, the subfields can be wrapped together.

setYear

public void setYear(int newYears)
Sets the current year.
Parameters:
newYears - The year as an int.

stateChanged

public void stateChanged(javax.swing.event.ChangeEvent event)
Event method of ChangedListener
Parameters:
event - javax.swing.event.ChangeEvent
Overrides:
stateChanged in class SpinnerGUI