r/JavaFX • • 2h ago

An interesting piece of info I learned about nested controllers

6 Upvotes

When you nest an fxml layout file inside another with fx:include, the controller of the containing (outer) fxml layout gets a reference to the controller of the included layout with a naming convention of: root+Controller:
This is not very clearly explained in the official docs (here).

I use -ctrl as a naming convention and just included the controller with its original name:
@ FXML

NestedCtrl nestedCtrl

@ FXML

VBox nestedRoot;

Turned out: No. it has to be nestedRootController in this case. Just wanted to share this. Cheers!


r/JavaFX • • 8h ago

AI Assisted/Generated Editora: a keyboard-driven code editor built on JavaFX 27 and RichTextFX (open source, MIT)

Thumbnail
gallery
25 Upvotes

I've been building Editora, an open-source code editor for Linux, macOS and Windows, on JDK 25, JavaFX 27, RichTextFX and AtlantaFX. It has LSP and debugger support for a long list of languages, Git with diff and merge views, Local History, a Markdown preview with math, and a Project Map that lays out your project on a canvas (still in beta). The installers bundle their own runtime, so you don't need a JDK.

A few JavaFX things I ran into along the way:

  • I forked RichTextFX to add multiple cursors and column selection. I also forked Flowless, the virtual flow underneath it, because it re-measured every visible line on each layout pass. Fixing that took FX-thread allocation per keystroke from about 7 MB to about 2.4 MB.
  • The packaged builds ship a JDK 25 AOT cache, trained against the app image's own runtime. First paint went from about 1.7 s to about 1.0 s on my machine.
  • When Prism can't start the GPU pipeline (on Linux, usually after a driver update without a reboot), the whole window lags. Editora now tells you in the status bar and in the Doctor, and turns off menu shadows in that mode, since redrawing the blur on every hover is what made the menus slow.
  • The performance tests in CI count frames per keystroke and FX-thread allocations instead of timing things. Counts come out the same on a busy CI runner as on my laptop.

Most of the code is written with Claude Code. I review it and rely on tests and build checks (NullAway, architecture tests, the performance budgets) to catch what I miss. I wrote about that here: https://www.adeleon.dev/blog/editora/

If you try it, I'd like to know how it runs on your setup, especially HiDPI on Windows and rendering on Linux. And if you've used RichTextFX for something big, what problems did you hit?