This is the code repository for Mastering JavaFX 10, published by Packt. It contains all the supporting project files necessary to work through the book from start to finish.
JavaFX is a set of libraries added to Java in order to provide capabilities to build a modern UI. It was added to Java a few releases ago, as old libraries—Swing and AWT—proved to be outdated and too burdened with backward compatibility issues. JavaFX was designed and developed from scratch to provide Java developers with the capabilities to build modern, rich UI applications with a large set of shapes, controls, and charts. It was designed with performance in mind, is capable of using graphics cards, and is based on the new graphical engine. In this book, we will study many aspects of JavaFX and go through a large set of examples based on these topics.
All of the code is organized into folders. Each folder starts with a number followed by the application name. For example, Chapter02.
The code will look like the following:
public static void main(String[] args) {
// you custom code
Application.launch(MyApplication.class, args);
}
I hope you agree that we really need to write actual code to study programming. This book is built around code samples. Every section in the book is accompanied by a corresponding code sample and, if applicable, screenshots. Before starting to read this book, I strongly encourage you to get a Git and download the accompanying GitHub repository, which you can find at https://github.com/sgrinev/mastering-javafx-9-10-book. There are about 130 code samples, grouped by chapters numbers. For your convenience, each chapter is a NetBeans project, but almost every code sample is self-sufficient and can be run separately without the help of an IDE. If you opt for the latter approach, you can find the guidelines for running JavaFX apps from the command line in Chapter 11, Packaging with Java9 Jigsaw. At the time of writing, you need the latest in-development version of Netbeans to work with Java 9 and 10. You can find it at http://bits.netbeans.org/download/trunk/nightly/latest/. While you can get a good grasp of the topics described by just reading the book and looking at the screenshots, toying with the code samples and seeing the results of your changes will give you a much better understanding of JavaFX APIs. Also, although the book has been released once and for all, I plan to update and fix these samples if any issues are found later on. Refer to GitHub's README.md for a history of changes.