O'Reilly logo

JavaFX™ Developer’s Guide by Kim Topley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

10. Triggers

As you saw in the preceding chapter, binding enables you to link the state of one variable to another, relieving you of the responsibility of writing the largely boilerplate code that would be required to achieve the same effect in a Java application. Sometimes when the value of variable changes you need to do something more than a mechanical update of all the state in the application that directly depends on that variable. Triggers give you the ability to execute arbitrary code whenever the value of a script variable or an instance variable is changed. In this chapter, you see how to declare a trigger and what can be done when a trigger is executed.

The source code for this chapter is in the javafxtriggers package in the JavaFX ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required