// msg from JTextfield public void focusLost(FocusEvent e) { if (e.getSource() == textField) { textField.setBackground(GUIGlobals.theme.InactiveTextField); this.fireFocusLost(e.isTemporary()); this.repaint(); } }
// 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); }
public void focusGained(FocusEvent e) { for (int i = 0; i < textfield.length; i++) { if (e.getSource() == textfield[i]) { textfield[i].setText(""); } } }
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(""); } } } }