JXDatePicker is a date picker that is built-in class in SwingX in JDK7.
Here is snippet code of JXDatePicker:

final JLabel label = new JLabel();
label.setText("Choose Date by selecting below.");
 
final JXDatePicker datePicker = new JXDatePicker(System.currentTimeMillis());
datePicker.addActionListener(new ActionListener() {
	public void actionPerformed(ActionEvent e) {
		label.setText(datePicker.getDate().toString());
	}
});
 
 
frame.getContentPane().add(label, BorderLayout.NORTH);
frame.getContentPane().add(datePicker, BorderLayout.CENTER);
Advertisements