views:

26

answers:

1

I want to subscribe to value changes on a JFormattedTextField.

Checking the source code, the only thing I see is that the property "value" is fired on a new value. But this property is only referenced there, and directly written, without a constant. If I subscribe to this property change, it works.

However, I'm wondering: is this the correct way to do that?

+3  A: 

JavaDoc for JFormattedTextField states[:

Once a JFormattedTextField has been created, you can listen for editing changes by way of adding a PropertyChangeListener and listening for PropertyChangeEvents with the property name value.

That means that you are using the correct way

ZloiAdun
Indeed, I missed this line in the javadoc. Thank you.
Gnoupi