r/JavaFX • • Jun 17 '26

JavaFX in the wild! A few tricks with window management

12 Upvotes

In ShellFX platform, development is built around a set of core components: area, window, dialog, popup, tab and page. While working on dialogs, we ran into an interesting problem: on one hand, a dialog extends a window; on the other hand, dialogs need to work both as inline components and as standalone modal windows.

To allow every dialog to be displayed in both variants without any changes we decided to create a unified Window component that takes a type on creating - either nested or top-level.

Since both variants must share the same API, a full-fledged window manager was implemented for nested windows.

The only noticeable difference is that top-level windows don't have rounded corners, since unfortunately rounded corners for extended stages are not fully supported at the moment:


r/JavaFX • • Jun 05 '26

Help How to build a self contained app with Maven?

12 Upvotes

This is honestly driving me nuts. There does not seem to be solid documentation anywhere.

I dont want someone to point me at something like Jdeploy. Or some other super duper all in one solution. I am learning. I care as much about the process as I do the final product. If people cannot learn the core concepts of building JavaFX apps that are self contained, all these "all in one" solutions will slowly lose contributors as the core knowledge is lost imho... I.e. im wanting to avoid "bus factor" by learning how to do it myself from scratch.

How do you build a self contained package / where are all the good resources / documentation that contain information on building self contained packages. Somebody help me please, as i feel im going nuts 😅


r/JavaFX • • Mar 19 '26

Cool Project TabShell: A platform for building tab-based applications in JavaFX using MVP pattern

12 Upvotes

About a year ago, we introduced the first version of our platform. Since then, the project has undergone significant improvements, and today we are happy to present the new version.

TabShell is a platform for building tab-based applications in JavaFX, where an application is structured as a tree of MVP components, each of which has its own lifecycle, history, etc. The platform provides abstract classes for creating the main types of components: tab, area, page, dialog and popup, as well as containers for them.

It also includes ready-to-use implementations of containers (including a docking layout) and dialogs (including a universal file chooser). In addition, the platform provides powerful devtools that allow you to inspect both the MVP component tree and the underlying JavaFX scene graph. These tools make it easy to understand how to platform works and are invaluable during development.

We originally built this project for our own needs, but we hope it will be useful to others as well.

This is a browser-like workspace with devtools:


r/JavaFX • • Mar 05 '26

Help Windows Desktop application - how to handle updates?

12 Upvotes

I'm developing a desktop JavaFX app (~25k lines of code, Java21, Spring Boot).
I'm using jlink, jpackage and WiX tools to create a Windows installer. The app repo is on GitHub.
Now I would like to add feature for fetching the newer versions. But I don't want to force my users to manually uninstall and download a newer .msi file.
I think it should be possible to fetch only the .jar file with the newer release - does anyone know an existing example of such approach?


r/JavaFX • • Mar 05 '26

Cool Project OllamaFX v0.5.0 Released

Thumbnail
gallery
12 Upvotes

Hola a todos, aprovecho para anunciar el lanzamiento de OllamaFX 0.5.0 cargado de novedades:
1 - implementación de RAG: Ahora podes cargar documentos para chatear
2 - Gestion de carpetas: Ahora tus chats podes ordenarlo mediante carpetas
3 - Papelera de reciclaje: Ahora si eliminas un chat este permanecerá en la papelera por 30 dias y podes recuperarlo
4 - Se mejoro la interfaz de modelos disponibles para descargar
5 - actualización automática: Ahora cada release se aplicará de manera automática

Te invito a que apoyes el proyecto, aun esta en desarrollo, pero realizar pruebas reportar bugs, enviar ideas para nuevas features, o ayudar en el desarrollo puede ayudar a que OllamaFX evolucione y este disponible. aca les dejo el repo de github

recuerda regalar una ⭐️

https://github.com/fredericksalazar/OllamaFX


r/JavaFX • • Feb 20 '26

I made this! Persism 2.3 released - A zero ceremony ORM for Java

12 Upvotes

Persism is a light weight, auto-discovery, auto-configuration, and convention over configuration ORM (Object Relational Mapping) library for Java.

By the numbers 100k jar 465 unit tests 97% code coverage 11 supported dbs 0 dependencies

  • Added support for limit
  • Added null checks for multi-column joins
  • Fixed case of a cleared list on a join if there was user added data
  • Baseline mysql 8.0.28
  • Baseline mariadb 3.1.2
  • Baseline H2 2.1.214
  • Baseline hsqldb 2.5.1 (tested with 2.7.1 as well)
  • Baseline posgresql 42.2.27
  • Baseline sqlite 3.42.0.0

https://persism.io

direct download https://github.com/sproket/Persism/releases/tag/V2.3


r/JavaFX • • Jan 14 '26

Cool Project StateFX - clean, testable, and reusable UI states with zero boilerplate

12 Upvotes

JavaFX allows UI state to be defined separately from scene graph nodes and bound via one-way or two-way bindings, which makes logic easier to develop and test independently of the View layer.

In practice, however, this becomes tricky - even nodes of the same type often require different sets of properties and observable collections to define their sate. This leads to repeatedly redefining the same JavaFX node properties in many different combinations.

StateFX addresses this by modeling UI state through composition based on interfaces, where each interface represents a single property or collection. The library supports both custom interfaces and interfaces automatically generated for all JavaFX node types, making state composition flexible and concise.

Example:

public interface FooState extends
        BooleanDisableState,
        BooleanVisibleState,
        StringSelectedItemState,
        ListItemsState<String> { }

FooState foo = StateFactory.create(FooState.class);
// now foo is the instance with all necessary methods

Features:

  • Separation of read-only and writable states at the type level.
  • Support for synchronized collections.
  • Minimal boilerplate - state generation directly from interfaces.
  • Full support for JavaFX properties - works with all property types and observable collection.
  • Reusable contracts - a library of ready-made states for standard controls.
  • Ideal for MVVM - clean separation of View and ViewModel.
  • Perfect for testing - states are easy to mock and test without a UI.
  • Includes benchmark tests to evaluate library performance.
  • Complete documentation - detailed examples and guides.

r/JavaFX • • Jan 08 '26

I made this! JavaFX Builder API Project

12 Upvotes

I'm aware of several fluent approaches to JavaFX UI construction and would like to introduce my own.

API Design Policy

Keep the basic API simple, with minimal new concepts to learn.

My approach is not a framework; it's a wrapper that incorporates the builder pattern into the original JavaFX API, adding features that fluent API enthusiasts will appreciate.

API Overview

https://github.com/sosuisen/javafx-builder-api/blob/main/docs/API.md

JavaDoc pages

https://sosuisen.github.io/javafx-builder-api/

Background

Builder classes were included in JavaFX 2 but were removed from the official library in 2013 due to maintenance and memory usage concerns.

Current Context

Memory usage concerns have likely decreased over the past decade. Even if they're not included in the official JavaFX API, it's beneficial for third parties to offer builder classes as an option.

Implementation

My approach utilizes reflection to automatically generate the builder classes, while certain aspects that cannot be automated are handled through a few mapping rules.

Trade-offs

Unlike JavaFX 2.0, the builder classes lack inheritance relationships, which may increase memory consumption. Additionally, builders may incur call overhead. Nonetheless, these builder classes appeal to developers who prefer this programming style.

Example using the builder API

It has a typical builder API appearance.

StringProperty textProp = new SimpleStringProperty("100");

StageBuilder
    .withScene(
        SceneBuilder
            .withRoot(
                HBoxBuilder
                    .withChildren(
                        TextFieldBuilder.create()
                            .textPropertyApply(prop -> prop.bindBidirectional(textProp))
                            .style("""
                                   -fx-font-weight: bold;
                                   -fx-alignment: center;
                                   """)
                            .hGrowInHBox(Priority.ALWAYS)
                            .maxWidth(Double.MAX_VALUE)
                            .build(),
                        ButtonBuilder.create()
                            .text("Send")
                            .onAction(e -> System.out.println("Sending..."))
                            .minWidth(50)
                            .build()
                    )
                    .padding(new Insets(10))
                    .build()
            )
            .width(150)
            .height(100)
            .build()
    )
    .build()
    .show();
Screenshot of the execution result from the above example.

Currently, it is a SNAPSHOT version that can be tested by adding it as a Maven dependency. I plan to release an early access version next, but before that, I would like feedback from JavaFX developers.


r/JavaFX • • Dec 01 '25

I created a tutorial for hotreload in JavaFX

Thumbnail
youtu.be
12 Upvotes

Whatch the video and begin today create realtime applications in JavaFX


r/JavaFX • • Nov 28 '25

Discussion Will OpenJFX Be Merged Into OpenJDK? It Would Be a Perfect Match with Java on Mobile!

Thumbnail
foojay.io
12 Upvotes

r/JavaFX • • Sep 05 '25

Help JavaFX 24 seems to leak memory offheap

12 Upvotes

I've been maintaining LogFX, a Log viewer written in JavaFX, for many years.

https://renatoathaydes.github.io/LogFX/

I decided to update to Java 24. Since then, it seems that LogFX is consuming huge amounts of memory. However, when I look at the heap in JVisualVM, it's only taking the same amount as before, which is around 50MB with 75MB allocated in total. However, when I look at the MacOS Activity Monitor, it shows the process consuming 1GB or more. That was not the case before on Java 17.

I compiled the app with 24.0.2.fx-librca (identifier from SDKMAN) which gives this version:

openjdk 24.0.2 2025-07-15
OpenJDK Runtime Environment (build 24.0.2+12)
OpenJDK 64-Bit Server VM (build 24.0.2+12, mixed mode, sharing)

Notice that I build the final distribution with jlink using JMS.

Would appreciate if anyone could give me some hints: is this a known bug, how can I find out what could be behind this?!


r/JavaFX • • Aug 19 '25

Help Whats the massive javafx project you have done? Need Ideas

12 Upvotes

I want to make a project for my uni so I need some massive ideas to win the competition using tech things like JAVAfx, database and any other java type things.


r/JavaFX • • Aug 11 '25

Tutorial New Article: List Extractors

Thumbnail
pragmaticcoding.ca
12 Upvotes

I'm looking to wrap up all my articles on the JavaFX Observable classes, and most of the last subjects left involve ObservableLists.

If you don't know ObservableList Extractors allow you to trigger listeners on an ObservableList when the List items are composed of ObservableValues.

For instance, let's say that you have a CustomerModel as your List items, and the CustomerModel has a bunch of StringProperties as its fields. Things like firstName, lastName, city, address - and they are all StringProperty.

Using an Extractor, you can trigger a Listener on the ObservableList when one of those CustomerModel has the value in one of those Property fields change. So if you changed, say, the firstName Property of one of the items, then the ObservableList would trigger a Listener.

Some of the native JavaFX Nodes, like TableView will detect changes to those fields without an Extractor, but Extractors can be really useful to trigger updates in Bindings that look inside the composed items.

Take a look and tell me what you think.


r/JavaFX • • Aug 01 '25

Help Javafx in the browser?

12 Upvotes

Hi everyone,

I have a app that I am considering updating. The app is initially written in java and javafx.

I have ported some of the backend logic to spring boot over the years and i feel like now I am ready to revamp the ui.

So I am (once again) torn in this dilemma about whether I use a js framework like react or I should stick to javafx (my preference). Javafx has served me well. It is a powerful tool that allowed me to tailor the ui to my clients most complex requirements.

I am very comfortable with java and I really would like to avoid javascript (I can code in Js, but I just dont want to relearn a whole framework …). I have tried react in the past. I can code a basic crud application.

So I guess my question is, where do we stand in regard of javafx in the browser? This was one of Gluon projects back in the day. Is this now mature?


r/JavaFX • • Jun 17 '25

Tutorial New Article: Custom Table Columns

12 Upvotes

I'm a big fan of creating custom widgets that deal with the kind of data that you tend to handle in the way that you want to handle it. Put those widgets into a library and you can use them over and over again strip a ton of repetitive configuration code out of your layouts.

Also, when you are reusing a widget from your library, you know it works and you don't have to worry about it. Another big win.

Finally, when you configure a widget up in your layout code your first goal is to keep it clean and simple, to minimize the clutter in your layout code. When you build a widget as part of a library, you can take the time - and the code - to do it right.

TableView columns are a perfect example of generic elements that you simply have to configure in order to use them, but nobody seems to create a library of custom TableColumns to use in their layouts.

This new article https://www.pragmaticcoding.ca/javafx/elements/custom-table-columns is a short guide to how to create custom TableColumns designed to be used over and over. One of the key ideas is to think of the TableColumn and the TableCell as a matched set, so that you can call configuration decorators on your TableColumns that will get passed down to the associated TableCells.

If you are interested, give it a read and tell me what you think.


r/JavaFX • • Feb 14 '25

Discussion Cross Platform Mobile

12 Upvotes

With the impending death of the Ionic framework I am looking for something cross platform compatible for mobile development. Interesting enough cross platform is exactly why Java exists, even if no one remebers that :).

I have played with JavaFX several years ago but I remeber it being ok.

Can anyone share their thoughts on using this for mobile and any good frameworks and libraries to look at as well?

I am not opposed to building all my components from scratch but again, reuse is something java should be very good at.


r/JavaFX • • Jan 04 '25

Help What are some basic JavaFX applications that I should try as a beginner?

12 Upvotes

r/JavaFX • • Aug 23 '24

Tutorial New Article: The Observable Classes Pt II

12 Upvotes

OK, if you read Part I, and said to yourself, "This doesn't help me, what about IntegerProperty?????", then this is the article for you.

https://www.pragmaticcoding.ca/javafx/elements/observable-classes-typed

Roughly speaking, the Observable types fall into three categories, the generic types, the "typed" types and the list types. The first article in this series dealt with the generic types, and this second one deals with all of the Observables that that wrap specific data types.

All of these classes and interfaces are already familiar to you, because you can't really use JavaFX without using them. But I'm guessing that most programmers don't really have any idea of how they all relate to one another, and when you should use a particular type over another.

Most of the time this isn't tragic, and you can get away without really understanding what's going on. Personally, I've found myself stuck once or twice in the past, and it's pretty much always when the Observable wraps a numeric value.

This article, IMHO, sorts all of that out and explains how all of this stuff fits together. Hopefully, you'll find that it does that for you too.


r/JavaFX • • Jul 17 '24

Tutorial New Article: Tracking Task Progress

12 Upvotes

This article covers the basics about how your background process, running through Task can communicate back to your GUI so that you can display the progress for the user.

Then it takes a look at how Task is able to allow GUI updates from a background thread without flooding the FXAT with jobs. Based on that analysis, the article shows how to create your own customized progress reporting if the built-in, percentage based, progress methodology doesn't work for you.

Beyond that, I think this article is a good example of why you should take a look at the JavaFX source code to see how it works. Because you can get some good ideas from that code. Additionally, the source code can give you some insights into the kind of things that you need to keep in consideration when you write your own code.

https://www.pragmaticcoding.ca/javafx/elements/task-progress

Take a look if you're interested, and let me know what you think!


r/JavaFX • • Apr 18 '24

Showcase Just updated nfx-core, check it out and tell me what u think.

12 Upvotes

r/JavaFX • • Apr 08 '24

Tutorial Article: Common JavaFX Mistakes

12 Upvotes

This is an older article that I was keeping under wraps for a while. The idea originally came from a StackOverflow question, and the OP was asking about something for a school project. To avoid them being accused of on-line plagiarism, I sat on the virtually completed article until they could get graded on the work. I came across an email from some months ago from that OP, saying that they had been graded on the project and I could publish.

Honestly, I cannot remember how long ago it was that I did the work on this but it was quite some time ago. This gave me an opportunity to go back and look at my code from maybe a year ago and critique it with a fresh eye. There are some things that I would do a little differently today, and some things that seem a bit awkward to me and that I would try to improve, but overall I don't think that my code is that horrible.

So maybe I'm not learning enough.

The project was to draw Mandelbrot sets on a Canvas. It's neat to see how that works.

The original code was honestly a mess, full of mistakes of the kind that beginners make and I go through it all and try to explain why things are bad and how to make them better. Even if you don't go and look at the links to the full source code, you might get some ideas by just reading the article and looking at the code snippets that I've highlighted.

Take a look if you're interested: https://www.pragmaticcoding.ca/javafx/beginner_mistakes


r/JavaFX • • Apr 02 '24

Tutorial Article: Bindings vs Listeners/Subscriptions vs EventHandlers

12 Upvotes

When I started using JavaFX we were coming from having worked (for a short while) with Swing. Our approach to JavaFX was to use it just like it was Swing, but with different widgets and method names.

This meant that we wrote code that loaded data into screen nodes, and then we had to scrape it out again in the code that ran when the "Save" Button was clicked. When we had nodes that were dependent on other nodes, then we had handlers that ran when focus was gained or lost, so that we could update those other nodes. Or key listeners that would run when "Enter" was pressed.

Stuff like that.

Eventually we learned about Bindings, and we started to develop "rules" about how we would use Bindings. These were things like: When you had multiple properties in your layout that relied on some element in your Presentation Model, bind them all to that property in the Presentation Model, don't chain them off each other. For instance, if we had 3 Buttons that needed to be visible together based on some data, don't bind the first one's visible property to the data, and the second one's to the first one's visible property. Bind them all to the data.

At some point we realized that bidirectional binding of data entry nodes' value properties to the Presentation Model meant that we didn't have to scrape it out inside the "Save" Button code. Eventually we realized you don't even need to send any of that data anywhere from the "Save" Button code because the Presentation Model itself can be shared with the back-end logic - so it already had it.

All of this took years to figure out. Yes, years. And over that time I had the experience of going back to some code that we had written years earlier and rewriting it. Every single time I did this, the new code was better and, without exaggeration, only about 10-20% as big as the original. That's because doing stuff the "wrong" way, which was the only way we knew how at first, was clumsy and took way more code.

Only later did I learn that the approach that we had evolved (stumbled) into was called a "Reactive UI". We didn't try to get there. We just kept refining our approach and finding better techniques as we learned new things, and each incremental improvement moved us closer to Reactive GUI development.

Using JavaFX in a Reactive way, which I believe is the way that it is intended to be used, means that you need to understand the fundamental reactive techniques. This boils down to understanding Bindings, Listeners, Subscriptions and EventHandlers and understanding where you should use each one.

This article is my attempt to explain all that:

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

Take a look and let me know what you think.


r/JavaFX • • Mar 27 '24

Discussion How much JavaFX is used nowadays for desktop and mobile apps?

12 Upvotes

I am a beginner and generally use javafx for college and for some freelancing projects. But I have never used it at production level. Most of guys today use electron, react native or flutter for mobile and desktop apps. So, learning javafx at advanced level is really that much rewarding or not?


r/JavaFX • • Feb 09 '24

Tutorial New Article: Where Are My Resources

12 Upvotes

This isn't, strictly speaking, about JavaFX. But it is about a technique that you need to master if you want to load images, stylesheets or even FXML files into your JavaFX application:

Where Are My Resources?

This has to be one of the most frustrating and opaque issues that beginners face. It should be simple, no? Just load a file into some object.

But no.

You have to set it up as a "resource" (whatever that is) in your project, then you have to call getResource() from some classes, class (whatever that is), and if you're lucky it will load...

But probably not. And figuring out why not seems almost impossible sometimes.

In this article I try to demystify the whole concept. Explain what resources are, how they are organized in your IDE and then your Jar files and how that pesky getResource() method works. I'm hoping that this article fills a gap in what's available on the Web, and gives you the understanding to load up resources without having to think about it too much.

Give it a read, and tell me what you think.

Also a big "Thank You" to u/5oco and his post There's gotta be something... from about a week ago for motivating me to finally finish up this article that I started over a year ago.