O'Reilly logo

JavaFX For Dummies by Doug Lowe

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

Chapter 15

Using Properties to Create Dynamic Scenes

In This Chapter

arrow Introducing and creating properties

arrow Working with read-only and read/write properties

arrow Adding event listeners to your properties

arrow Binding properties together

In this chapter, you discover how to use a powerful feature of JavaFX — properties. Simply put, a JavaFX property is an observable value that’s exposed by a class. Properties are observable in the sense that you can attach listeners to them. These listeners can be invoked whenever the value of the property changes or becomes unknown.

One of the best features of properties is that you can bind to them, or connect properties together so that when one property changes, the other property is adjusted automatically. In other words, binding allows two properties to be synchronized. When one property changes, the other property changes as well.

In this chapter, I discuss the basics of working with properties. First, you read about how to create your own properties. Then, you figure out how to attach listeners to properties so your code can respond when the property ...

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