Is there something like event.getSource for DocumentListener too? Im trying to change color of just one JTextField in which is text changing. Here is my DocumentListener:
DocumentListener posluchac = new DocumentListener() {
public void changedUpdate(DocumentEvent e) {
warn(e);
}
public void removeUpdate(DocumentEvent e) {
warn(e);
}
public void insertUpdate(DocumentEvent e) {
warn(e);
}
public void warn(DocumentEvent e) {
txtName.setBackground(Color.WHITE);
txtSurname.setBackground(Color.WHITE);
txtPersonalNumber.setBackground(Color.WHITE);
txtDateOfBirth.setBackground(Color.WHITE);
}
};
If there is nothing like .getSource()
for DocumentListener. How to do it?