|
swingx Version 2005-08-19 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
org.jdesktop.swingx.JXDatePicker
public class JXDatePicker
A component that combines a button, an editable field and a JXMonthView component. The user can select a date from the calendar component, which appears when the button is pressed. The selection from the calendar component will be displayed in editable field. Values may also be modified manually by entering a date into the editable field using one of the supported date formats.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
static String |
DATE_IN_MILLIS
|
static String |
EDITOR
|
static String |
LINK_PANEL
|
static String |
MONTH_VIEW
|
static String |
uiClassID
UI Class ID |
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 |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
JXDatePicker()
Create a new date picker using the current date as the initial selection and the default abstract formatter JXDatePickerFormatter . |
|
JXDatePicker(long millis)
Create a new date picker using the specified time as the initial selection and the default abstract formatter JXDatePickerFormatter . |
Method Summary | |
---|---|
void |
addActionListener(ActionListener l)
Adds an ActionListener. |
void |
commitEdit()
Forces the current value to be taken from the AbstractFormatter and set as the current value. |
protected void |
fireActionPerformed()
Fires an ActionEvent to all listeners. |
String |
getActionCommand()
Returns the string currently used to identiy fired ActionEvents. |
int |
getBaseline(int width,
int height)
Get the baseline for the specified component, or a value less than 0 if the baseline can not be determined. |
Date |
getDate()
Returns the currently selected date. |
long |
getDateInMillis()
Returns the currently selected date in milliseconds. |
JFormattedTextField |
getEditor()
Returns the formatted text field used to edit the date selection. |
DateFormat[] |
getFormats()
Returns an array of the formats used by the installed formatter if it is a subclass of JXDatePickerFormatter |
long |
getLinkDate()
|
JPanel |
getLinkPanel()
Return the panel that is used at the bottom of the popup. |
JXMonthView |
getMonthView()
Return the JXMonthView used in the popup to
select dates from. |
TimeZone |
getTimeZone()
Gets the time zone. |
DatePickerUI |
getUI()
|
String |
getUIClassID()
|
boolean |
isEditable()
|
boolean |
isEditValid()
Returns true if the current value being edited is valid. |
void |
postActionEvent()
|
void |
removeActionListener(ActionListener l)
Removes an ActionListener. |
void |
setActionCommand(String actionCommand)
Sets the string used to identify fired ActionEvents. |
void |
setComponentOrientation(ComponentOrientation orientation)
|
void |
setDate(Date date)
Set the currently selected date. |
void |
setDateInMillis(long millis)
Set the currently selected date. |
void |
setEditable(boolean value)
|
void |
setEditor(JFormattedTextField editor)
|
void |
setFormats(DateFormat[] formats)
Replaces the currently installed formatter and factory used by the editor. |
void |
setFormats(String[] formats)
Replaces the currently installed formatter and factory used by the editor. |
void |
setLinkDate(long linkDate,
String linkFormatString)
Set the date the link will use and the string defining a MessageFormat to format the link. |
void |
setLinkPanel(JPanel linkPanel)
Set the panel that will be used at the bottom of the popup. |
void |
setMonthView(JXMonthView monthView)
Set the component to use the specified JXMonthView. |
void |
setTimeZone(TimeZone tz)
Sets the time zone with the given time zone value. |
void |
setUI(DatePickerUI ui)
Sets the L&F object that renders this component. |
void |
updateUI()
Resets the UI property with the value from the current look and feel. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String uiClassID
public static final String EDITOR
public static final String MONTH_VIEW
public static final String DATE_IN_MILLIS
public static final String LINK_PANEL
Constructor Detail |
---|
public JXDatePicker()
JXDatePickerFormatter
.
The date picker is configured with the default time zone and locale
setTimeZone(java.util.TimeZone)
,
getTimeZone()
public JXDatePicker(long millis)
JXDatePickerFormatter
.
The date picker is configured with the default time zone and locale
millis
- initial time in millisecondssetTimeZone(java.util.TimeZone)
,
getTimeZone()
Method Detail |
---|
public DatePickerUI getUI()
public void setUI(DatePickerUI ui)
ui
- public void updateUI()
updateUI
in class JComponent
UIManager.getUI(javax.swing.JComponent)
public String getUIClassID()
getUIClassID
in class JComponent
public void setFormats(String[] formats)
java.text.SimpleDateFormat
class.
formats
- The string formats to use.SimpleDateFormat
public void setFormats(DateFormat[] formats)
formats
- The date formats to use.public DateFormat[] getFormats()
JXDatePickerFormatter.
javax.swing.JFormattedTextField.AbstractFormatter
and javax.swing.text.DefaultFormatter
do not have
support for accessing the formats used.
- Returns:
- array of formats or null if unavailable.
public void setDate(Date date)
date
- datepublic void setDateInMillis(long millis)
millis
- millisecondspublic Date getDate()
public long getDateInMillis()
public JXMonthView getMonthView()
JXMonthView
used in the popup to
select dates from.
public void setMonthView(JXMonthView monthView)
monthView
- month view comopnentsetTimeZone(java.util.TimeZone)
,
getTimeZone()
public TimeZone getTimeZone()
TimeZone
used by the JXMonthView
.public void setTimeZone(TimeZone tz)
tz
- The TimeZone
.public long getLinkDate()
public void setLinkDate(long linkDate, String linkFormatString)
linkDate
- Date in millisecondslinkFormatString
- String used to format the linkMessageFormat
public JPanel getLinkPanel()
public void setLinkPanel(JPanel linkPanel)
linkPanel
- The new panel to install in the popuppublic JFormattedTextField getEditor()
public void setEditor(JFormattedTextField editor)
public void setComponentOrientation(ComponentOrientation orientation)
setComponentOrientation
in class Component
public boolean isEditValid()
public void commitEdit() throws ParseException
ParseException
public void setEditable(boolean value)
public boolean isEditable()
public int getBaseline(int width, int height)
width
- Width of the component to determine baseline for.height
- Height of the component to determine baseline for.
public String getActionCommand()
public void setActionCommand(String actionCommand)
actionCommand
- The string used for identifying ActionEvents.public void addActionListener(ActionListener l)
The ActionListener will receive an ActionEvent when a selection has been made.
l
- The ActionListener that is to be notifiedpublic void removeActionListener(ActionListener l)
l
- The action listener to remove.protected void fireActionPerformed()
public void postActionEvent()
|
swingx Version 2005-08-19 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |