public void focusGained(FocusEvent e){
  Component c=e.getComponent();
  if (c instanceof JFormattedTextField) {
    selectItLater(c);
  }
}

public void focusGained ( FocusEvent e ) { Component c = e . getComponent ( ) ; if ( c instanceof JFormattedTextField ) { selectItLater ( c ) ; } }
called when one of the fields gets the focus so that we can select the focused field .
