Make JavaFX looks like it was in the future.

A hands-on guide to custom controls, skins, window chrome, runtime theme switching, and Fluent Design materials — for desktop developers who want their app to feel current.

ThemeManager.java
// three-tier tokens, resolved live
public class ThemeManager {
  public void applyTheme(Theme theme) {
    tokens.resolve(theme.palette());
    scene.getStylesheets().setAll(
      theme.stylesheet());
  }
  // switches instantly, no restart
  onThemeChanged.fire(theme);
}

Ten chapters, built from one ambitious idea

This book is for the developer who has just discovered that no existing control does quite what the project needs. It is for the developer who has find out that some default controls cannot be stylized easily from CSS.

This book will guide you to create your own UI control library. If you can think and design a rich or ambitious UI control then this book will be your main resource.

01
The Basic Skeleton
This chapter covers the architecture behind custom controls and skins. Here you will be equipped with the minimun skeleton that you need for your implementation.
02
Updating Properties
This part of the book covers how to communicate a skin with its corresponding control by adding ChangeListener or declaring bindings on properties.
03
Bounds
This is an optional chapter for reading. It covers the three kinds of layout bounds that JavaFX provides.
04
Regions and Layouts
This is an optional chapter for reading. It explain how the layoutChildren() method works and how the developer can performs clipping operations on nodes.
05
Styling from CSS
This is a powerful chapter, it must be read carefully. Here you will learn how to customize your controls by defining your own CSS rules like: -fx-my-rule.
06
Switching Modes
This chapter shows how an application can switch between Light Mode and Dark Mode without rebuilding the entire user interfaces.
07
Virtualization
This is an optional chapter for reading. It explains how the Virtualization process works on controls like ListView, TableView and TreeView.
08
Microinteractions
This is an optional chapter for reading. It recommends to create an animation library with normal and premium microinteractions to be integrate it in custom skins.
09
Fluent
This is a mandatory chapter for reading. It integrates all the skills covered in Chapter 1-5. Here we will dissect the code behind Mica, Acrylic, Reveal and you will learn how to provide your own mechanism for a backdrop blur.
10
Custom Stages
This chapter teachs how to implement your own professional window from zero by avoiding the default ones that the OS offers for free.