EarthWeb
Developer.com
Site
windows 2000
visual c++
java
visual basic
javascripts
recommend it
 
Book
thinking in java
 
Interact
forum
guest book
jobs
jokes
what's new

share code
 
Resource
add resource
modify resource
new resource
 

[Internet Jobs]
-----
Java by E-mail:

Get the weekly e-mail highlights on Java!
-----
-

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

Inner classes inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Inner classes inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, 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
DateChooser()
          Construct a new DateChooser.
DateChooser(Calendar date)
          Construct a new DateChooser with the specified selected date.
 
Method Summary
 void actionPerformed(ActionEvent evt)
          Handle events.
 void addActionListener(ActionListener listener)
          Add a ActionListener to this component's list of listeners.
 Color getHighlightColor()
          Get the highlight color for this component.
 Calendar getMaximumDate()
          Get the latest selectable date for the chooser.
 Calendar getMinimumDate()
          Get the earliest selectable date for the chooser.
 Calendar getSelectedDate()
          Get a copy of the Calendar object that represents the currently selected date.
static boolean isLeapYear(int year)
          Determine if a year is a leap year.
 void removeActionListener(ActionListener listener)
          Remove a ActionListener from this component's list of listeners.
 void setDateFormat(SimpleDateFormat format)
          Set the format for the textual date display at the bottom of the component.
 void setHighlightColor(Color color)
          Set the highlight color for this component.
 void setMaximumDate(Calendar date)
          Set the latest selectable date for the chooser.
 void setMinimumDate(Calendar date)
          Set the earliest selectable date for the chooser.
 void setSelectedDate(Calendar date)
          Set the selected date for the chooser.
 
Methods inherited from class kiwi.ui.KPanel
getComponentByName, paintComponent, setFocusOrder, setTexture
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUIClassID, paramString, updateUI
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

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.
Method Detail

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.


internet.commerce



Acceptable Use Policy

JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers