yearTextField.addKeyListener(keyListener);
// listener to select year text when spinner is "spun"
PropertyChangeListener spinListener = new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent e) {
yearTextField.selectAll();
}
};
yearTextField.addPropertyChangeListener("value", spinListener);
// make calendar update whenever an edit is made to the year selection