单击日历窗口时如何失去 JFormatedTextfeild 的焦点
private void dateTxtFocusGained(java.awt.event.FocusEvent evt) {
// TODO add your handling code here:
PickDate ex=new PickDate();
// dateTxt.setText(Helper.pickDate.toString());
}
...
private class MyDateListener implements DateListener
{
public void dateChanged(DateEvent e)
{
Calendar c = e.getSelectedDate();
if (c != null) {
formatTxt.setText(c.getTime());
PickDate.this.dispose(); // pickdate is nothing but JFrame in which calender shows
}
else {
System.out.println("No time selected.");
}
}
}