I have a class PanouAddContoriMetro with
jtfSeria.addPropertyChangeListener(new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
// do something
}
}
working when called from PanouAddContoriMetro class : jtfSeria.setText("Test");
but not working when I change the property from another
class (PanouExpAutorizatii) : pacm.jtfSeria.setText("Test");
I think the problem here is that you think a
PropertyChangeListenerwill listen tosetText()- It doesn't. In the documentation of thepropertyChangemethod it states:Furthermore in the
setTextmethod's documentation:So, here is an example using a
DocumentListener. Everything appearing gray in the log was fired by thePropertyChangeListener, everything black by theDocumentListener: