开发者

What is the "good way" to subscribe to value changes in a JFormattedTextField?

开发者 https://www.devze.com 2023-01-09 05:06 出处:网络
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 re开发

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 re开发者_JS百科ferenced 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?


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

0

精彩评论

暂无评论...
验证码 换一张
取 消