How do I get events when a text control loses focus?

I have a JavaFX 2 application and I need to do something when textfield loses focus But when I lose focus, I can't see anything happening on the node

Is it possible to listen for focus loss events on textfield in some way?

Solution

Add a changelistener to the focusedproperty of textfield

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>