

JavaFX Techniques


Don't Use FXML
2 mins
It seems that one of the initial selling points of JavaFX, back in 2014 was that you could use drag and drop to design your layouts, and this would be stored as something called FXML. I don’t think you should use it, and you can read why right here.

Model-View-Controller-Interactor
Model-View-Controller-Interactor (MVCI) is a framework I designed specifically to work with Reactive JavaFX. It’s very similiar to MVC and MVVM, but has a few key differences that make it way better for JavaFX. This section has articles that explain why MVC, MVVM and MVP fail, why MVCI is better, and how to start using MVCI to create clear and simple applications that are easy to understand and maintain.


Custom Controls
1 min
JavaFX provides all the tools that you need to create your own
Nodes that just as good as the standard one provided by the library. These articles talk about how to go about creating your custom Nodes that behave exactly the way that you want them to.

Stop Using PropertyValueFactory
5 mins
PropertyValueFactory is an obsolete convenience method designed to eliminate boilerplate. We don’t don’t need it any more now that we have Lambda expressions.

JavaFX Anti-Pattern: The Dispatch EventHandler
8 mins
The “Dispatch EventHandler”. For some reason I see this in examples on the web all over the place, I think because it’s a technique that seems to integrate with FXML. The idea is that you create a single EventHandler and you invoke it from all of the Buttons (or whatever) on your GUI. In that EventHandler, you check the passed Event and run different code depending on which Button triggered it.
It’s a bad approach that adds complexity to your code and returns you nothing. In this article you’ll see how this approach fails, and how to properly write EventHandlers in a clear and simple way.
