Example #1
0
 // msg from JTextfield
 public void focusLost(FocusEvent e) {
   if (e.getSource() == textField) {
     textField.setBackground(GUIGlobals.theme.InactiveTextField);
     this.fireFocusLost(e.isTemporary());
     this.repaint();
   }
 }
Example #2
0
 // msg from JTextfield
 public void focusGained(FocusEvent e) {
   if (e.getSource() == textField) {
     this.fireFocusGained(e.isTemporary());
   } else // if the label get's the focus then delegate it to textfield
   {
     textField.grabFocus();
     // !!! field could be not visible (scrollpane!)
     // insert mechanism to ensure visibility
   }
   textField.setBackground(GUIGlobals.theme.ActiveTextField);
 }
Example #3
0
 public void focusGained(FocusEvent e) {
   for (int i = 0; i < textfield.length; i++) {
     if (e.getSource() == textfield[i]) {
       textfield[i].setText("");
     }
   }
 }
Example #4
0
 public void focusGained(FocusEvent e) {
   for (int i = 0; i < textfield.length; i++) {
     if (e.getSource() == textfield[i]) {
       textfield[i].setForeground(Color.black);
       if (textfield[i].getText().equalsIgnoreCase(DEFAULT[i])) {
         textfield[i].setText("");
       }
     }
   }
 }