|
|||||||||
| Home >> All >> com >> theotherbell >> [ ui overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
com.theotherbell.ui
Class DateField

java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
com.theotherbell.ui.DateField
- All Implemented Interfaces:
- javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable
- public final class DateField
- extends javax.swing.JPanel
GUI component that lets the user enter a date using a drop-down DatePicker. Usage is illustrated in the sample code below:
JDialog dlg = new JDialog(new Frame(), true);
DateField df = new DateField();
dlg.getContentPane().add(df);
dlg.pack();
dlg.show();
if (null != df.getDate())
System.out.println(df.getDate().toString());
dlg.dispose();
System.exit(0);
- Version:
- 1.1a
| Nested Class Summary | |
(package private) class |
DateField.Listener
Listener that will catch the selected date when the DatePicker is hidden. |
| Nested classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
| Nested classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
| Nested classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
| Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
private javax.swing.JTextField |
dateText
Displays the currently selected date. |
private javax.swing.JDialog |
dlg
The DatePicker's container. |
private DatePicker |
dp
The current DatePicker instance. |
private javax.swing.JButton |
dropdownButton
When clicked, displays the DatePicker immediately under the text field. |
| 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.Container |
|
| 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 | |
DateField()
Default constructor; the initially selected date is "empty". |
|
DateField(java.util.Date initialDate)
Alternate constructor that initializes the currently selected date to the specified date. |
|
| Method Summary | |
private static java.lang.String |
dateToString(java.util.Date dt)
Returns a short string representation for the specified date (January 1, 2003). |
java.util.Date |
getDate()
Returns the currently selected date or null if not set. |
private void |
init()
Initializes the panel components. |
private void |
onButtonClick(java.awt.event.ActionEvent evt)
Event handler that displays the DatePicker when the button is clicked. |
private static java.util.Date |
stringToDate(java.lang.String s)
Constructs a Date object from a short date (January 1, 2003). |
| Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
dateText
private final javax.swing.JTextField dateText
- Displays the currently selected date.
dropdownButton
private final javax.swing.JButton dropdownButton
- When clicked, displays the DatePicker immediately under the text field.
dp
private DatePicker dp
- The current DatePicker instance.
dlg
private javax.swing.JDialog dlg
- The DatePicker's container.
| Constructor Detail |
DateField
public DateField()
- Default constructor; the initially selected date is "empty".
DateField
public DateField(java.util.Date initialDate)
- Alternate constructor that initializes the currently selected date
to the specified date.
| Method Detail |
getDate
public java.util.Date getDate()
- Returns the currently selected date or null if not set.
init
private void init()
- Initializes the panel components.
onButtonClick
private void onButtonClick(java.awt.event.ActionEvent evt)
- Event handler that displays the DatePicker when the button is
clicked.
dateToString
private static java.lang.String dateToString(java.util.Date dt)
- Returns a short string representation for the specified date (January 1, 2003).
stringToDate
private static java.util.Date stringToDate(java.lang.String s)
- Constructs a Date object from a short date (January 1, 2003).
|
|||||||||
| Home >> All >> com >> theotherbell >> [ ui overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC