Exemplo n.º 1
0
 public void focusGained(FocusEvent e) {
   Component c = e.getComponent();
   if (c instanceof TextField) ((TextField) c).selectAll();
 }
Exemplo n.º 2
0
 public void focusLost(FocusEvent e) {
   Component c = e.getComponent();
   if (c instanceof TextField) ((TextField) c).select(0, 0);
 }
Exemplo n.º 3
0
 public void focusGained(FocusEvent e) {
   fieldWithFocus = e.getSource();
   if (fieldWithFocus == widthField) constainAspectRatio = true;
   else if (fieldWithFocus == yField) constainAspectRatio = false;
 }