Last week I did a talk about JavaFX at Jfokus 2012 in Stockholm, when I realized that there are three questions I am asked at every event. There seems to be a general interest, so I try to answer them in this post (as much as I can to be honest):
The functionality of JavaFX ChangeListeners and InvalidationListeners is very similar. It can be hard to see a difference at all. Both types differ mainly in their runtime behavior. In fact, if performance matters, chosing the wrong type can destroy everything.
My suggestion is to stick to a simple rule: use a ChangeListener if you need to know the new value in the listener, otherwise use an InvalidationListener. In this article I will explain the reasons.
Continue reading “When to use a ChangeListener or an InvalidationListener”
The JavaFX runtime provides two possibilities to create read-only properties. You can either use a wrapper (e.g. ReadOnlyDoubleWrapper) or you can extend an abstract base class (e.g. ReadOnlyDoublePropertyBase). This article shows how these two approaches can be implemented.
Continue reading “Creating read-only properties in JavaFX”