Skip to content
Advertisement

How perform task on JavaFX TextField at onfocus and outfocus?

I am working on JavaFX project. I need to perform some task on a JavaFX TextField.

For example on the “on focus” event for the TextField I want to print

JavaScript

and on the “out focus” event it should print

JavaScript

Advertisement

Answer

I thought it might be helpful to see an example which specifies the ChangeListener as an anonymous inner class like scottb mentioned.

JavaScript

I hope this answer is helpful!

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement