Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   *  Copyright (c) 2011 Leibniz Institute of Plant Genetics and Crop Plant Research (IPK), Gatersleben, Germany.
   *  All rights reserved. This program and the accompanying materials
   *  are made available under the terms of the GNU Lesser Public License v2.1
   *  which accompanies this distribution, and is available at
   *  http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
   *
   *  Contributors:
   *      Leibniz Institute of Plant Genetics and Crop Plant Research (IPK), Gatersleben, Germany - RMI Client, FileChooser and WebDAV
  */
 package de.ipk_gatersleben.bit.bi.edal.publication;
 
 
 import java.util.Date;
 
 
 
 
DatetimePicker provides a swing panel for the user to choose Datetime.

Author(s):
chenj
arendd
Version:
2.0
 
 public class DateTimePicker extends JPanel {
 	private static final long serialVersionUID = 1L;
 	private EdalDateChooser dateChooser = null;
 	
 	private JTextField text;
 	private JLabel label;

Constructs a DatetimePicker that is initialized with edaldate. If the parameter are null this method will initialize the DatetimePicker with current time

Parameters:
edaldate EDALDate object to show in DatetimePicker panel
 
 
 	public DateTimePicker(final EdalDate edaldate) {
 		setBorder(null);
 
 		GridBagLayout gridBagLayout = new GridBagLayout();
 
 		setLayout(gridBagLayout);
 
 		 = new JTextField();
 		.setEditable(false);
 
 		ImageIcon icon = ImageUtil.createImageIcon("dateIcon.gif",
 				"choose new datetime");
 		 = new JLabel(icon);
 		.setToolTipText("choose new datetime");
 
 		addComponent(thisgridBagLayout, 0, 0, 1, 1, 0.95, 1, 1, 1);
 		addComponent(thisgridBagLayout, 1, 0, 1, 1, 0.05, 1, 1, 1);
 
 			public void mouseClicked(MouseEvent e) {
 				if ( == null) {
 					 = new EdalDateChooser(edaldate,false);
 				}
 				int returnVal = .showDateChooser();
 				if (returnVal == .)
 				{
 				}
 			}
 		});
 	}
 
 	static void addComponent(Container contGridBagLayout gblComponent c,
 			int xint yint widthint heightdouble weightx,
			double weightyint ipadxint ipady) {
		gbc.ipadx = ipadx;
		gbc.ipady = ipady;
		gbc.gridx = x;
		gbc.gridy = y;
		gbc.gridwidth = width;
		gbc.gridheight = height;
		gbc.weightx = weightx;
		gbc.weighty = weighty;
		gbc.insets = new Insets(0, 0, 0, 0);
		gbl.setConstraints(cgbc);
		cont.add(c);
	}

reset the time to current time
	public void reset() {
		if ( != null) {
		}
	}

Returns the Calendar, which is selected by user.

Returns:
the Calendar, which is selected by user.
	public Calendar getCalendar() {
		if ( != null) {
		}
		return null;
	}

Returns the EDALDatePrecision, which is selected by user.

Returns:
the EDALDatePrecision, which is selected by user.
		if ( != null) {
		}
		return null;
	}
	private void setDate(Date date) {
	}
New to GrepCode? Check out our FAQ X