r/JavaFX • • Jun 25 '26

I made this! FX Flow 0.6.1 released, declarative UI building for JavaFX

11 Upvotes

I've released FX Flow 0.6.1, a JavaFX utility library focused on declarative UI construction, and reducing boilerplate around models, validation and reactive UI updates. See the end of this post for a full example.

Some highlights since the 0.5 release:

Validation feedback directly from domains

Domains can now contain Rules, which is a predicate associated with a Template explaining why a value is invalid. All built-in domain factory methods now provide validation messages. Domains can provide templates for out of range values, misaligned values, missing values, non matching values (regex), etc.

Together with the new ValidationEvent, AbstractMarkerPane and ValidationMarkerPane, validation feedback can be surfaced in the UI without wiring validation logic directly into controls. See the ValidationSampleApplication.

Coordinated observable updates

A new UpdatableValue type allows multiple values to be updated atomically, ensuring listeners never observe intermediate state because the listeners of the individual properties are only fired until all values have been updated:

// Create two updatable values (similar to properties):
UpdatableValue<String> firstName = UpdatableValue.of("Jane");
UpdatableValue<String> lastName = UpdatableValue.of("Smith");

// Observe them:
Observe.values(firstName, lastName)
    .subscribe((fn, ln) -> System.out.println(fn + " " + ln));  // prints "Jane Smith"

// Modify both properties at once:
UpdatableValue.set(
    firstName, "John",
    lastName, "Doe"
);

In this example, it will initially print Jane Smith followed by John Doe. The subscriber only sees the final (John, Doe) state. If you put a direct ChangeListener on one of these properties (and then use get to read the value of the other) you will not observe a temporary incorrect combination either (so you will never see Jane Doe or John Smith).

The advantage of using Observe.subscribe with multiple values is convenience, and that you also get notified if only one of the values changed (ie. from John Doe to John Miller) without having to manually monitor both properties.

Feedback and suggestions are welcome.

GitHub: https://github.com/int4-org/FX/releases

Full example:

public class ValidationSampleApplication extends Application {

  public static void main(String[] args) {
    Application.launch(args);
  }

  @Override
  public void start(Stage primaryStage) {
    StringModel name = StringModel.of(Domain.regex("[A-Z][a-z]+", Template.of("custom.startsWithCapital")));
    IntegerModel age = IntegerModel.of(null, Domain.bounded(18, 120));

    /*
     * Create a scene with a ValidationMarkerPane as the root. Markers will be overlaid
     * on the controls within the pane:
     */

    Scene scene = Scenes.create(
      ValidationMarkerPane.of().onMarkerCreated(this::installTooltip).content(
        Panes.vbox("form").nodes(
          Panes.grid("grid")
            .row("Name", FX.textField().promptText("Name (e.g. John)").model(name))
            .row("Age", FX.textField().promptText("Age (18-120)").model(age)),
          FX.button().text("Submit")
            .enable(Observe.booleans(name.valid(), age.valid()).allTrue())
        )
      )
    );

    /*
     * Add some basic styling.
     */

    scene.getStylesheets().add(StyleSheets.inline(
      """
      .form {
        -fx-padding: 2em;
        -fx-spacing: 1.5em;
        -fx-alignment: top-center;
      }
      .grid {
        -fx-hgap: 1em;
        -fx-vgap: 1em;
      }
      """
    ));

    primaryStage.setScene(scene);
    primaryStage.setTitle("Validation Marker Sample");
    primaryStage.sizeToScene();
    primaryStage.show();
  }

  private void installTooltip(Marker marker) {
    marker.validationIssueProperty().subscribe(issue -> {
      Tooltip tooltip = marker.getTooltip();

      if(tooltip == null) {
        tooltip = new Tooltip();

        marker.setTooltip(tooltip);
      }

      tooltip.setText(switch(issue) {
        case ValidationIssue.Invalid(Object _, Template template) -> toMessage(template);
        case ValidationIssue.Incompatible(Template template) -> toMessage(template);
      });
    });
  }

  static String toMessage(Template template) {
    return MessageFormat.format(
      switch(template.key()) {
        case "domain.missing" -> "Must not be empty";
        case "domain.invalid" -> "Must be a valid value";
        case "domain.notContained" -> "Must be one of {0}";
        case "domain.noMatch" -> "Must match regular expression {0}";
        case "domain.outOfRange" -> "Must be between {0} and {1}";
        case "domain.misaligned" -> "Must be a multiple of {1} starting from {0}";
        case "conversion.incompatible" -> "Must be a compatible value";
        case "custom.startsWithCapital" -> "Must consist of two or more letters and start with a capital";
        default -> "Invalid (" + template.key() + ")";
      },
      template.args().values().toArray()
    );
  }
}

r/JavaFX • • May 13 '26

JavaFX in the wild! JDK pull request: 8248122: java launcher should launch normally if JavaFX modules not found

Thumbnail github.com
11 Upvotes

r/JavaFX • • May 10 '26

I made this! I mage GhosttyFX, it's a JavaFX terminal that uses libghostty

Thumbnail
github.com
11 Upvotes

Just wanted to share a project I made, a terminal view that uses Canvas for rendering.


r/JavaFX • • Apr 29 '26

Showcase CEFFX: Prebuilt natives added - no need to compile anything

11 Upvotes

We recently introduced our CEFFX project (a library for integrating the Chromium Embedded Framework into JavaFX) and it was well received. Based on that feedback, we decided to simplify its usage by providing prebuilt native libraries. This allows you to use the library without having to compile anything yourself.

All native binaries are packaged into the ceffx-natives module using classifier names similar to those in OpenJFX:

  • linux (ubuntu-22.04 runner)

  • win (windows-2022 runner)

  • mac (macos-15-intel runner)

  • mac-aarch64 (macos-15-arm64 runner)

The last one (mac-aarch64) will be available once the runner becomes free... eventually :)

The README contains detailed instructions on how to use them, and the overall flow is illustrated in this demo diagram:

Before the release, it is necessary to use our snapshot repo. Tested on Linux and Windows.


r/JavaFX • • Mar 24 '26

Help Request: Looking for a maintained JavaFX docking framework

11 Upvotes

Could you suggest any maintained and supported window docking framework for JavaFX?

Whatever I could find looks pretty stale and dead at the moment:

Also found https://github.com/Beowolve/SnapFX

But this one is not released.


r/JavaFX • • Aug 18 '25

Discussion My experience switching from Java swing to JavaFX

Thumbnail reddit.com
11 Upvotes

r/JavaFX • • Aug 14 '25

I made this! nfx-lib update v-1.0.3. Need Window testers pls

11 Upvotes

nfx-lib repo

Hey guys I just posted an update and added a new NfxStage class, if you want to test it and give some feedback it will be amazing, no need to build native code if you want, just run the Demo.

PS : Windows 10 and 11


r/JavaFX • • May 12 '25

I made this! COCO Annotation Viewer

11 Upvotes

https://github.com/trinity-xai/CocoAnnotationViewer
Recently added support for the COCO annotation standard for images inside Trinity XAI. Decided to make the test app available as a standalone project.


r/JavaFX • • Feb 06 '25

Cool Project MVVM4FX: a tiny library for developing JavaFX applications using MVVM

11 Upvotes

The library provides all the necessary interfaces and base class implementations for creating components, which serve as the units of the MVVM pattern. Examples of components include tabs, dialog windows, toolbars, image viewers, help pages, and more.

Each component has template methods initialize() and deinitialize(), which manage its lifecycle. This simplifies the contol of initialization processes, dependency setup, and resource cleanup when the component is removed.

Key features include:

  • Support for the component lifecycle.

  • Organization of core tasks within the view.

  • Component inheritance.

  • Ability to preserve component history.

  • Designed without considering FXML support.

  • Detailed documentation and sample code.

Check it out here: mvvm4fx

We developed this library for our own projects, but we'd be happy if it can be useful to others as well.


r/JavaFX • • Dec 30 '24

Discussion A new theme for JavaFX

Thumbnail mail.openjdk.org
11 Upvotes

r/JavaFX • • Dec 21 '24

Cool Project FXGL 25 DevStream: Adding Shaders to JavaFX

Thumbnail
youtube.com
11 Upvotes

r/JavaFX • • Sep 18 '24

Tutorial New Article: Quick Guide to MVCI

11 Upvotes

Jekyll tells me this is a 20 minute read, so "quick" may not be so true...

Model-View-Controller-Interactor (MVCI) is my own take on a framework that is somewhat like MVC and MVVM but tailored to work with Reactive applications written in JavaFX. The other frameworks are good for what they are, but they don't quite dovetail perfectly with JavaFX, especially if you are writing in a Reactive way. My experience is that MVCI solves all of the issues with the other frameworks, and is actually easier to understand because the Presentation Model is split out from the business logic.

In this article, I take a quick look at the other frameworks and why they aren't quite right then take a look at the components of MVCI. There's an explanation about how to decide where to put your code, and a simple but complete example that shows how it all goes together.

This introductory article is a bit more complete than some others because it includes a discussion about how you would connect to external API's and databases - which is technically outside the scope of the framework itself. So in this respect it really does give you a complete overview of how to use the framework in a real-world situation.

Finally the article ends by discussing the coupling and dependencies in the framework. This might seem a little technical for a "quick guide", but I think it's important as it gives a good grounding for making decisions when you're building your own applications with the framework.

Anyway, the article is here:

https://www.pragmaticcoding.ca/javafx/elements/mvci-quick


r/JavaFX • • Sep 09 '24

Tutorial New Article: ComboBoxes

11 Upvotes

ComboBoxes are deceptively simple. Just stick a list of String in one and off you go. But even then, there are some things that seem to confuse people. I see a LOT of code where the programmer uses comboBox.getSelectionModel().getSelectedItem() instead of comboBox.getValue(). I don't know why, maybe there's some example out there that did it that way years ago and it's been copypasta'd all over the web.

https://www.pragmaticcoding.ca/javafx/elements/comboboxes

In this tuturial I cover the basics and then look at some ways to do some more sophisticated things. Specifically I look at including images in the pop-up list, handling codes and descriptions in a ComboBox and then how to link two ComboBoxes so that the selection in the first changes the options in the second.

Even if you know ComboBoxes, it might be worth a read.


r/JavaFX • • Jun 17 '24

Tutorial Intro to JavaFX with Gradle in Intellij Idea

11 Upvotes

Maybe I'm a little bit late to the party with this one, because I'm getting the sense that less and less people are trying to create Java projects without using a build engine. However...

If you're struggling to figure out how to use Gradle with JavaFX, or if you wondering why you should use Intellij Idea instead of Eclipse or (gasp!) VSCode, this might be worth a read.

Honestly, it takes longer to read this article than it does to actually get a project up and running using Gradle and Intellij Idea. But I try to explain how things work and what the steps do as I go along.

The process in this article is to start off with an empty Idea session, start up the "New Project" wizard, picking the correct options and then letting it go. Then when the project is opened, tying up a few loose ends and running the "Hello World" app that it creates - just to prove that everything is copacetic at the start.

Then I go through fine tuning the settings, stripping out the FXML rubbish and re-organizing the structure into a framework.

Finally, there's a look at the build.gradle file, to understand a little bit of its structure so that you at least have a step forward if you want to do further customization.

The whole thing is presented in a step-by-step manner with lots and lots of screenshots.

I hope you find this helpful:

https://www.pragmaticcoding.ca/javafx/gradle-intellij


r/JavaFX • • Apr 04 '24

Help Random portions of the UI flashing white. No exceptions logged. No clue what the issue is.

11 Upvotes

r/JavaFX • • Oct 04 '23

Tutorial Math Visualization with JavaFX: Creating a Graphical Calculator

11 Upvotes

In the world of mathematics, visualization plays a pivotal role in understanding complex concepts and solving intricate problems. One effective way to enhance mathematical understanding is by creating a graphical calculator. In this article, we will explore how to build a graphical calculator using JavaFX, a powerful framework for building interactive user interfaces. We will also use the org.mariuszgromada.math.mxparser library to handle mathematical expressions. By the end of this article, you will have a fully functional graphical calculator at your fingertips.

🔗 Math Visualization with JavaFX: Creating a Graphical Calculator


r/JavaFX • • Sep 11 '23

Tutorial Internationalization in JavaFX: Building Multilingual Apps

11 Upvotes

What is Internationalization and Localization?

Internationalization (i18n) is the process of designing your application so that it can be easily adapted to different languages and regions without code changes. This typically involves separating user-interface text and other locale-specific data from the application’s code. Localization (l10n) is the process of translating and adapting an internationalized application to a specific locale or language. This includes translating text, formatting dates and numbers, and adjusting other cultural aspects.

🔗 Internationalization in JavaFX: Building Multilingual Apps


r/JavaFX • • Aug 12 '23

Tutorial JavaFX ControlsFX StatusBar

11 Upvotes

What is ControlsFX StatusBar?

ControlsFX is an open-source project that extends the capabilities of JavaFX with additional custom controls, enhancements, and utilities. One of its components is the StatusBar, which is a versatile control designed to provide feedback, status updates, and contextual information to users. The StatusBar is especially useful in applications where users need to be informed about ongoing processes, status changes, or other relevant information.

🔗 JavaFX ControlsFX StatusBar


r/JavaFX • • Aug 04 '23

Tutorial JavaFX SplitPane: A Tool for Flexible User Interfaces

11 Upvotes

What is SplitPane?

The SplitPane is a layout container that allows its child nodes to be divided horizontally or vertically with adjustable dividers. It enables users to resize the sections of the UI, making it ideal for scenarios where flexible layouts are required, such as in IDEs, file explorers, or any application that demands a customizable UI layout.

🔗 JavaFX SplitPane: A Tool for Flexible User Interfaces


r/JavaFX • • Aug 02 '23

Tutorial JavaFX TreeView: Organizing Your Data in Hierarchical Structures

11 Upvotes

Customizing TreeView with Graphics

JavaFX TreeView allows you to customize the appearance of tree nodes by using graphics or icons. Let’s create an example where we display icons for each language:

🔗JavaFX TreeView: Organizing Your Data in Hierarchical Structures


r/JavaFX • • Mar 24 '23

JavaFX in the wild! JavaFX links of the week for March 18th-24th 2023

11 Upvotes

You can follow Frank Delporte on Twitter and and Foojay.social to get these "Links of the Week" updates as soon as they happen.


r/JavaFX • • Oct 21 '22

Discussion This useful 4-line PR has been sitting on the OpenJFX Gradle Plugin repo for 1.5 years now

11 Upvotes

https://github.com/openjfx/javafx-gradle-plugin/pull/103

The JavaFX Gradle plugin has a platform property which is used to get the appropriate Maven dependency for the current platform. So if you are running the build on Windows for example, it will use the win dependency.

This makes sense, but when you use JLink to create a runtime for your application to be run on other operating systems, this all breaks apart. Why? Because the platform property cannot be changed, it is auto-detected in all cases.

So this very simple PR was made to fix the issue (it just makes it non-final and adds a setter & updates the dependencies on change). But as with everything Oracle and Gluon, there's the agreements where you need to provide your personal details which I think discouraged this contributor.

The user didn't do that, so this PR is completely ignored. At this point, they can literally just close the PR and make the change themselves. We that use JLink and want to target other OSes than the one it is running on need to remove the JavaFX plugin and manually declare the dependencies.

I'm just hoping somebody at Gluon or somebody that has accepted the agreement can do something about this..


r/JavaFX • • Sep 14 '22

JavaFX in the wild! JavaFX links of the week as posted on jfx-central.com

11 Upvotes
  • On the JavaFX mailinglist this thrilling message appeared: "Create release notes for JavaFX 19." And yes, they are available now on GitHub!

    • If you want to keep following what’s happening inside the JavaFX community, you can suscribe to it via mail.openjdk.org/mailman/listinfo/openjfx-dev.

    • As with previous releases, the JavaFX community once again succeeded in keeping the 6-months release cycle going on, with a long list of improvements and fixes!

  • Pavlo Iatsiuk announced the first release of DynamoIt — a JavaFX GUI client application for AWS DynamoDB - on Reddit.

  • Robert Ladstätter announced the 1000th download of LogoRRR, another JavaFX GUI application!

  • Dirk Lemmermann (of all people...!) got frustrated in this Tweet that he once again had to prove “No, JavaFX is not dead”.

    • Let's all help him in proving a lot of amazing stuff is happening with JavaFX by sharing your project with us!

    • We welcome your contribution via @jfxcentral on Twitter or a contribution to this site on GitHub.


r/JavaFX • • Apr 20 '22

Tutorial Automate Your JavaFX App Deployments and Updates with jDeploy and GitHub Actions

Thumbnail
jdeploy.substack.com
11 Upvotes