Generally, certain kinds of data need to be displayed in TableViews in certain, specific ways. This article will show you how to create custom TableColumns, along with matching custom TableCells, that you can use over and over in every application that you build.
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.
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.
Introduction # After literally a decade writing JavaFX applications, it can be hard to remember how I thought things were supposed to be done when I started out. Thankfully, there seems to be a nearly endless supply of beginners having trouble, posting their code and giving us a glimpse into their thought processes.
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.
Is there such a thing as a “Right” or “Wrong” when looking at different approaches to solving a programming problem? Can one approach be objectively better than another? Spoiler alert: yes, it can.
Dialogs are the basic tools for interacting with the user in a controlled way as part of a procedural flow. They are best thought of as a way to collect and return information from the user.
Why? # Most of the tutorial articles I’ve written here have been of the “deep dive” nature. I try to go way beyond the information available in the JavaDocs, and to give some insight into how to get the most out of the tools that JavaFX provides. These articles tend to be on the long side, Jekyll tells me that they average about 13 minutes of reading, and there’s usually lots of code examples and pontification about clean coding and on and on.
Introduction # Hex Maps, or hex boards are a popular platform for tabletop games, especially wargames and Role Playing Games. They are uniquely useful because hexagons fit nicely into a grid and there are 6 directions from each hexagon (or just, “hex”), compared to just 4 with a grid made up of squares.
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.
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! 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.