01: package com.xoetrope.awt.date;
02:
03: import java.util.Date;
04:
05: import java.awt.BorderLayout;
06: import java.awt.Point;
07:
08: import net.xoetrope.awt.XDialog;
09:
10: /**
11: * Encapsulates an instance of the XDateChooser class in a modal dialog
12: * <p> Copyright (c) Xoetrope Ltd., 2001-2006, This software is licensed under
13: * the GNU Public License (GPL), please see license.txt for more details. If
14: * you make commercial use of this software you must purchase a commercial
15: * license from Xoetrope.</p>
16: * $Revision: 1.2 $
17: */
18: public class XDateChooserDialog extends XDialog {
19: XDateChooser dateChooserCtl;
20:
21: /**
22: * Creates a new dialog
23: * @param onScreen the top left corrdiante of the new dialog.
24: */
25: public XDateChooserDialog(Point onScreen) {
26: super (true, 0);
27:
28: setSaveOnClose(false);
29: setLocation(onScreen);
30: setSize(140, 120);
31: contentPanel.setLayout(new BorderLayout());
32: contentPanel.add(dateChooserCtl = new XDateChooser(),
33: BorderLayout.CENTER);
34: dateChooserCtl.addNavigation(true);
35: }
36:
37: /**
38: * Gets the current date.
39: * @return the date
40: */
41: public Date getDate() {
42: return dateChooserCtl.getDate();
43: }
44:
45: /**
46: * Sets the current date.
47: * @param newDate the new date
48: */
49: public void setDate(Date newDate) {
50: dateChooserCtl.setDate(newDate);
51: }
52: }
|