package com.xoetrope.awt.date;
import java.util.Date;
import java.awt.BorderLayout;
import java.awt.Point;
import net.xoetrope.awt.XDialog;
/**
* Encapsulates an instance of the XDateChooser class in a modal dialog
* <p> Copyright (c) Xoetrope Ltd., 2001-2006, This software is licensed under
* the GNU Public License (GPL), please see license.txt for more details. If
* you make commercial use of this software you must purchase a commercial
* license from Xoetrope.</p>
* $Revision: 1.2 $
*/
public class XDateChooserDialog extends XDialog
{
XDateChooser dateChooserCtl;
/**
* Creates a new dialog
* @param onScreen the top left corrdiante of the new dialog.
*/
public XDateChooserDialog( Point onScreen )
{
super( true, 0 );
setSaveOnClose( false );
setLocation( onScreen );
setSize( 140, 120 );
contentPanel.setLayout( new BorderLayout());
contentPanel.add( dateChooserCtl = new XDateChooser(), BorderLayout.CENTER );
dateChooserCtl.addNavigation( true );
}
/**
* Gets the current date.
* @return the date
*/
public Date getDate()
{
return dateChooserCtl.getDate();
}
/**
* Sets the current date.
* @param newDate the new date
*/
public void setDate( Date newDate )
{
dateChooserCtl.setDate( newDate );
}
}
|