Menu

#11 When selected the DateField should select the content

open
nobody
None
5
2006-09-27
2006-09-27
No

When a DateField gets the focus, it should select the
date text in the field (usual feature with textfields).

the way to achieve this is, in the init() method of
DateField to add this:

field.addFocusListener(new FocusAdapter() {
public void focusGained(java.awt.event.FocusEvent e) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
field.selectAll();
}
});
}
});

I hope this is ok and that you may consider adding it
to Nachocalendar

Thanks

benoit

Discussion


Log in to post a comment.