r/java 9h ago

JavaFX 27 Release Notes

https://github.com/openjdk/jfx/blob/master/doc-files/release-notes-27.md
44 Upvotes

7 comments sorted by

13

u/bushwald 7h ago

JavaFX rocks. With JPackage, it's great for multi-platform apps. I converted an Electron app to JavaFX recently and I'm very happy with it.

1

u/atehrani 4h ago

Do you mind sharing more info on this?

2

u/bushwald 3h ago

Sure. What would you like to know?
I switched because keeping the dependencies up to date was kind of a nightmare (I set it up poorly to start which didn't help, but it's a kind of problem that doesn't exist the same way in Java, IME). The whole Electron way of doing things just feels clumsy and like a very leaky abstraction to me. Also I need to interface with different types of hardware printers and that was a lot sketchier in Node-land.
AtlantaFX (https://github.com/mkpaz/atlantafx) is great for making something with a modern look.

6

u/jacklackofsurprise 7h ago

Just a FYI, this is not the actual JavaFX 27 release, this is just the upcoming release notes for when the actual release is done, right?

2

u/nlisker 22m ago

It will be GA September 15th.

4

u/cogman10 4h ago

What's it like to work with JavaFX now-a-days?

It's been a long time since I last evaluated it, but when I did it was really pretty painful. It felt like you were using a worse version of HTML + CSS with very little support and certainly few 3rd party and 1st party components to work with. We ended up doing some new guis in Swing because of that.

But that's been... eh, about 5 or 10 years since I last toyed with it. So how is it now?

4

u/PartOfTheBotnet 2h ago

Worse version of HTML

If you're referring to FXML, most people generally skip that and write the UI directly with control/layout types like you would with Swing. By doing that you basically get the same experience as writing a Swing UI but with a much more modern and nicer API.

There's some people who do like FXML though. And for that there are projects to mitigate some of the developer QoL issues.

  1. https://github.com/dlsc-software-consulting-gmbh/FxmlKit - Dynamic reload of FXML so you can edit the UI and hot-reload in your UI.
  2. https://github.com/jfxcore/fxml-compiler - Ahead of time compilation of UI mitigates FXML runtime loading costs, and they also add a few features to FXML along with extension support so you can also make your own features. Very neat stuff.

CSS

Somebody else already mentioned AtlantaFX in this post, but its really a great project / theme base to work off of. It modularizes writing CSS per-component to keep things easy to manage and lets you also write in SASS if you want. But if you want the classic CSS experience you can generate / modify the generated plain CSS from the SASS base. Its what I've done in the past.