When to use a ChangeListener or an InvalidationListener

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”