Skip to main content

Javafx

Converting FXML to Code

47 mins
Introduction # Recently, I posted an article titled, Should You Use FXML?. In that article, I stated that I felt that well written and organized code would always be easier to maintain than any corresponding FXML/FXML Controller would be. I did not emphasize this, as the article was intended to be a discussion about the merits and costs of using FXML more than as a “is this better than this?”, exploration.

Should You Use FXML?

39 mins
Introduction # From time to time the question about, “To FXML or not to FXML” comes up on Reddit and other social media, and I’m know as being firmly in the “Not FXML” camp. I’ve had a few people message me about this, so I thought it might be a good time to examine this topic in depth.

An Introduction to Properties

28 mins
If you are a beginner with JavaFX and are wondering, “What are all these Property things anyway?”, then this is the article for you. Besides the Properties themselves, we also cover the basics of using them with Bindings and Listeners. Read this article and you should have a good idea how to start out with JavaFX Properties.

Guide To the Observable Classes - Part II

This article is about the all of the typed observable classes and interfaces except the ones concerned with List. You’ll find that all of the relationships and structure found in the generic classes is just about exactly the same, but then there are a few extra classes and interfaces added to the hierarchy depending on the type of data that they hold. We’ll concentrate mostly on two types, String and Integer here, because dealing with the others would just be redundant. String is typical of stand-alone types, and Integer is typical of types that are included in Number.

JavaFX: Quick Guide to MVCI

20 mins
Introduction - Why Use a Framework? # Frameworks are all about organizing your application so that it will be easy to maintain, enhance and expand over time.

Example: Hexadecimal Editor

7 mins
Here’s a sample application that uses a ListView to display and edit bytes in a data file, showing the values in hex, octal, binary, decimal and as characters.

FXML is NOT Model-View-Controller

17 mins
Introduction # OK, first off I know I’m swimming against the stream here, and at odds with things like this found in some of the tutorial pages from Oracle for JavaFX:

An Introduction to Model-View-Controller-Interactor

22 mins
Introduction # This article is an introduction to and a “how to” for the framework that I’ve developed for building Reactive JavaFX applications. It’s called “Model-View-Controller-Interactor”, or just, “MVCI”.

Multi-MVCI Projects

24 mins
Projects With Multiple Screens and Functions # One of the questions that seems to come up fairly often is about how to create a project that is composed of a number of different screens and functions.

How to Swap Scenes Properly

13 mins
Taking a look at the three most common design patterns for building systems with user interfaces. How are they different? which one is best? Is there anything better?

Wordle in Kotlin JavaFX

16 mins
The original Wordle is JavaScript in a browser, here’s an implementation of it in Reactive JavaFX written in Kotlin.

Demystifying PseudoClasses in JavaFX

11 mins
Pseudo Classes are the best way to handle on/off state changes in a Node in JavaFX. But it’s very badly explained in the JavaDocs and hard to understand. This article should clear that up.

How to Write a JavaFX Screen without FXML & Scene Builder

17 mins
Way, way back in 2014 when I started learning JavaFX, I tried using Scene Builder and FXML and found it to be an amazing waste of time and effort. One of the best decisions I ever made was to abandon it early on, and just code screens by hand. I advise everyone else to do the same.

Hangman in JavaFX

13 mins
How much code does it take to build a complete Hangman game in JavaFX? It turns out … Not much!

Implementing MVC in JavaFX

14 mins
Model-View-Controller is generally accepted as a good way to structure an application with a user interface. While JavaFX contains all of the classes needed to implement MVC in a natural and seamless way, it doesn’t seem to be widely documented and there’s little evidence on the Web that many people have figured out how to do it properly. The fact that JavaFX supports Reactive programming makes a big difference to how you should implement MVC.

TextFields and TextFormatter - Part 2

11 mins
A more in-depth look into how to build a TextFormatter that can be used to turn a TextField into sophisticated input field. We’ll look at designing a TextFormatter that is tailored to handle fixed place decimal input, using the decimal point itself as a control to toggle between the ordinal and mantissa of the number.

TextFields and TextFormatter - Part 1

8 mins
An introduction to TextFormatter, showing you how to integrate it into a TextField and how to use it to convert the input from String to some other kind of value. Then we’ll look at how to add a filter to prevent the user from entering invalid data.

MineSweeper in JavaFX

19 mins
MineSweeper! Everyone’s favourite time-waster Windows game. Implemented in JavaFX showing how the reactive nature of JavaFX can be used with MVC to create a game.