kiwi.ui
Class DateChooser
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Container
|
+--javax.swing.JComponent
|
+--javax.swing.JPanel
|
+--kiwi.ui.KPanel
|
+--kiwi.ui.DateChooser
public class DateChooser extends KPanel implements ActionListener
This class represents a date chooser. The chooser allows an arbitrary date
to be selected by presenting a calendar with day, month and year selectors.
The range of selectable dates may be constrained by supplying a minimum
and/or maximum selectable date. The date chooser is fully locale-aware.
An example DateChooser.
Version: 3.0 (07/99)
Author: Mark Lindner, PING Software Group
See Also: Serialized Form
Constructor Summary
DateChooser ()
Construct a new DateChooser.
DateChooser (Calendar date)
Construct a new DateChooser with the specified selected
date.
Methods inherited from class javax.swing.JComponent
addAncestorListener ,
addNotify ,
addPropertyChangeListener ,
addVetoableChangeListener ,
computeVisibleRect ,
contains ,
createToolTip ,
firePropertyChange ,
firePropertyChange ,
firePropertyChange ,
firePropertyChange ,
firePropertyChange ,
firePropertyChange ,
firePropertyChange ,
firePropertyChange ,
firePropertyChange ,
fireVetoableChange ,
getActionForKeyStroke ,
getAlignmentX ,
getAlignmentY ,
getAutoscrolls ,
getBorder ,
getBounds ,
getClientProperty ,
getComponentGraphics ,
getConditionForKeyStroke ,
getDebugGraphicsOptions ,
getGraphics ,
getHeight ,
getInsets ,
getInsets ,
getLocation ,
getMaximumSize ,
getMinimumSize ,
getNextFocusableComponent ,
getPreferredSize ,
getRegisteredKeyStrokes ,
getRootPane ,
getSize ,
getToolTipLocation ,
getToolTipText ,
getToolTipText ,
getTopLevelAncestor ,
getVisibleRect ,
getWidth ,
getX ,
getY ,
grabFocus ,
hasFocus ,
isDoubleBuffered ,
isFocusCycleRoot ,
isFocusTraversable ,
isLightweightComponent ,
isManagingFocus ,
isOpaque ,
isOptimizedDrawingEnabled ,
isPaintingTile ,
isRequestFocusEnabled ,
isValidateRoot ,
paint ,
paintBorder ,
paintChildren ,
paintImmediately ,
paintImmediately ,
processComponentKeyEvent ,
processFocusEvent ,
processKeyEvent ,
processMouseMotionEvent ,
putClientProperty ,
registerKeyboardAction ,
registerKeyboardAction ,
removeAncestorListener ,
removeNotify ,
removePropertyChangeListener ,
removeVetoableChangeListener ,
repaint ,
repaint ,
requestDefaultFocus ,
requestFocus ,
resetKeyboardActions ,
reshape ,
revalidate ,
scrollRectToVisible ,
setAlignmentX ,
setAlignmentY ,
setAutoscrolls ,
setBackground ,
setBorder ,
setDebugGraphicsOptions ,
setDoubleBuffered ,
setEnabled ,
setFont ,
setForeground ,
setMaximumSize ,
setMinimumSize ,
setNextFocusableComponent ,
setOpaque ,
setPreferredSize ,
setRequestFocusEnabled ,
setToolTipText ,
setUI ,
setVisible ,
unregisterKeyboardAction ,
update
Methods inherited from class java.awt.Container
add ,
add ,
add ,
add ,
add ,
addContainerListener ,
addImpl ,
countComponents ,
deliverEvent ,
doLayout ,
findComponentAt ,
findComponentAt ,
getComponent ,
getComponentAt ,
getComponentAt ,
getComponentCount ,
getComponents ,
getLayout ,
insets ,
invalidate ,
isAncestorOf ,
layout ,
list ,
list ,
locate ,
minimumSize ,
paintComponents ,
preferredSize ,
print ,
printComponents ,
processContainerEvent ,
processEvent ,
remove ,
remove ,
removeAll ,
removeContainerListener ,
setLayout ,
validate ,
validateTree
Methods inherited from class java.awt.Component
action ,
add ,
addComponentListener ,
addFocusListener ,
addInputMethodListener ,
addKeyListener ,
addMouseListener ,
addMouseMotionListener ,
addPropertyChangeListener ,
bounds ,
checkImage ,
checkImage ,
coalesceEvents ,
contains ,
createImage ,
createImage ,
disable ,
disableEvents ,
dispatchEvent ,
enable ,
enable ,
enableEvents ,
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 ,
isEnabled ,
isLightweight ,
isShowing ,
isValid ,
isVisible ,
keyDown ,
keyUp ,
list ,
list ,
list ,
location ,
lostFocus ,
mouseDown ,
mouseDrag ,
mouseEnter ,
mouseExit ,
mouseMove ,
mouseUp ,
move ,
nextFocus ,
paintAll ,
postEvent ,
prepareImage ,
prepareImage ,
printAll ,
processComponentEvent ,
processInputMethodEvent ,
processMouseEvent ,
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
DateChooser
public DateChooser ()
Construct a new DateChooser. The selection will be
initialized to the current date.
DateChooser
public DateChooser (Calendar date)
Construct a new DateChooser with the specified selected
date.
Parameters: date - The date for the selection.
getSelectedDate
public Calendar getSelectedDate ()
Get a copy of the Calendar object that represents the
currently selected date.
Returns: The currently selected date.
setSelectedDate
public void setSelectedDate (Calendar date)
Set the selected date for the chooser.
Parameters: date - The date to select.
setMinimumDate
public void setMinimumDate (Calendar date)
Set the earliest selectable date for the chooser.
Parameters: date - The (possibly null ) minimum selectable date.
getMinimumDate
public Calendar getMinimumDate ()
Get the earliest selectable date for the chooser.
Returns: The minimum selectable date, or null if there is no
minimum date currently set.
setMaximumDate
public void setMaximumDate (Calendar date)
Set the latest selectable date for the chooser.
Parameters: date - The (possibly null ) maximum selectable date.
getMaximumDate
public Calendar getMaximumDate ()
Get the latest selectable date for the chooser.
Returns: The maximum selectable date, or null if there is no
maximum date currently set.
setDateFormat
public void setDateFormat (SimpleDateFormat format)
Set the format for the textual date display at the bottom of the
component.
Parameters: format - The new date format to use.
actionPerformed
public void actionPerformed (ActionEvent evt)
Handle events. This method is public as an implementation side-effect.
Specified by: actionPerformed in interface ActionListener
isLeapYear
public static boolean isLeapYear (int year)
Determine if a year is a leap year.
Parameters: year - The year to check.Returns: true if the year is a leap year, and false
otherwise.
addActionListener
public void addActionListener (ActionListener listener)
Add a ActionListener to this component's list of listeners.
Parameters: listener - The listener to add.
removeActionListener
public void removeActionListener (ActionListener listener)
Remove a ActionListener from this component's list of
listeners.
Parameters: listener - The listener to remove.
setHighlightColor
public void setHighlightColor (Color color)
Set the highlight color for this component.
Parameters: color - The new highlight color.
getHighlightColor
public Color getHighlightColor ()
Get the highlight color for this component.
Returns: The current highlight color.