i'm using JCalendar and i initialize it in this way:
popup = new JPopupMenu();
calendar = new JCalendar();
popup.add(calendar);
calendar.addDateListener(new DateListener() {
@Override
public void dateChanged(DateEvent de) {
Calendar c = de.getSelectedDate();
if (c != null) {
String data = c.get(Calendar.DAY_OF_MONTH) + "-" + (c.get(Calendar.MONTH) + 1) + "-" + c.get(Calendar.YEAR);
dateTextField.setText(data);
popup.setVisible(false);
}
}
});
dateTextField.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
popup.show(e.getComponent(), e.getX(), e.getY());
popup.setVisible(true);
}
});
In this way when i click on the textfield dateTextField
it shows popup with JCalendar
but it show me today's date selected and if i want to show that date in my textfield i have to choose another date and then choose another time today's date. How can i remove default selected date? thanks!!!