|
Copyright © 2011 Citra Technologies. All Rights Reserved. | ||||||||
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
javax.swing.JPanel
com.citra.editors.JDateChooser
public class JDateChooser
A date chooser that contains controls for specifying year, month, date and time.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
JPanel.AccessibleJPanel |
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 | |
---|---|
protected boolean |
keepSelectedDate
flag that indicates whether the selected date should be kept, when changing the month or year from the gui |
protected boolean |
showDatePanel
flag that controls the date panel's visibility. |
protected boolean |
showTimePanel
flag that controls the time panel's visibility. |
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 | |
---|---|
JDateChooser()
Creates a new JDateChooser object. |
Method Summary | |
---|---|
void |
clearSelectionDate()
|
static JDialog |
createDialog(Component parent,
String title,
boolean modal,
JDateChooser dateChooser,
ActionListener okListener,
ActionListener cancelListener)
Creates and returns a new dialog containing the JDateChooser object and buttons for controlling the dialog. |
Calendar |
getDateFromGUI()
Returns a calendar object which is initialized to the selected values shown on the datechooser panel. |
boolean |
getKeepSelectedDate()
Determines whether the selected date should be kept, when changing the month or year. |
Calendar |
getSelectedDate()
Returns a calendar object which is initialized to the selected date. |
boolean |
getShowDatePanel()
Determines whether the date panel is visible. |
boolean |
getShowSeconds()
Determines whether the date chooser will show and accept seconds in the time field box. |
boolean |
getShowTimePanel()
Determines whether the time panel is visible. |
void |
loadCurrentDate()
Positions the date chooser to the current date. |
void |
loadDate(Calendar calendar)
Positions the date chooser to the date specified by calendar . |
void |
loadDate(Date date)
Positions the date chooser to the date specified by date . |
void |
setDefaultTime(String defaultTime)
Assigns the default time to show when the time field is visible. |
void |
setKeepSelectedDate(boolean keepSelectedDate)
Determines whether the selected date should be kept, when changing the month or year. |
void |
setSelectedDate(Date date)
Selects and positions the date chooser to the specified date. |
void |
setShowDatePanel(boolean showDatePanel)
Specifies whether the date panel should be visible. |
void |
setShowSeconds(boolean showSeconds)
Determines whether the date chooser will show and accept seconds in the time field box. |
void |
setShowTimePanel(boolean showTimePanel)
Specifies whether the time panel should be visible. |
void |
updateUI()
Resets the UI property with a value from the current look and feel. |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected boolean showTimePanel
protected boolean showDatePanel
protected boolean keepSelectedDate
Constructor Detail |
---|
public JDateChooser()
Method Detail |
---|
public void clearSelectionDate()
public static JDialog createDialog(Component parent, String title, boolean modal, JDateChooser dateChooser, ActionListener okListener, ActionListener cancelListener)
The "OK" button hides the dialog and stores the selected date.
The "Cancel" button hides the dialog without storing the selected date.
The "Reset" button resets the date chooser to the date which was set when the dialog was invoked.
Furthermore, the user can supply his own ActionListeners that will be invoked when the "OK" or "Cancel" buttons are pressed.
parent
- the parent component for the dialogtitle
- the title for the dialogmodal
- boolean specifying whether the dialog is modaldateChooser
- the date chooser to be placed inside the dialogokListener
- the ActionListener invoked when "OK" is pressedcancelListener
- the ActionListener invoked when "Cancel" is pressed
public Calendar getDateFromGUI()
public boolean getKeepSelectedDate()
public Calendar getSelectedDate()
public boolean getShowDatePanel()
public boolean getShowSeconds()
public boolean getShowTimePanel()
public void loadCurrentDate()
public void loadDate(Calendar calendar)
calendar
.
calendar
- the calendar object which the date chooser will show.public void loadDate(Date date)
date
.
date
- the date which the date chooser will show.public void setDefaultTime(String defaultTime)
defaultTime
- the default time in the format HH:MMpublic void setKeepSelectedDate(boolean keepSelectedDate)
keepSelectedDate
- true, if the date is to be kept, false otherwisepublic void setSelectedDate(Date date)
date
- the date which this chooser will show.public void setShowDatePanel(boolean showDatePanel)
showDatePanel
- true if the date panel is visible, false otherwisepublic void setShowSeconds(boolean showSeconds)
showSeconds
- true, if seconds are shown, false otherwise.public void setShowTimePanel(boolean showTimePanel)
showTimePanel
- true if the time panel is visible, false otherwisepublic void updateUI()
updateUI
in class JPanel
JComponent.updateUI()
|
Copyright © 2011 Citra Technologies. All Rights Reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |