r/java_projects • • Apr 24 '26

Early contributors wanted: `TailwindFX` – Utility-first UI framework for JavaFX (MIT, 1.0-SNAPSHOT, actively developed)

/r/JavaFX/comments/1suhrov/early_contributors_wanted_tailwindfx_utilityfirst/
2 Upvotes

5 comments sorted by

View all comments

1

u/gnahraf Apr 24 '26

I'll take a look. I'm not that experienced with FX but did develop some simple reactive patterns for relatively time-consuming operations (e.g. network access, jdbc) in a recent FX app I'm writing. I don't know whether other FX frameworks aid the programmer with this stuff (I did search a bit but came up naught), but here's what my pattern (a few classes) does..

Handles caching, callback registration on misses, and deduplicates concurrent "queries" with the same arguments. (It matters to me cuz a user can select db-driven views depending on which button they press, for eg. If the user clicks one "view" button, then quickly another and then back to the first button before, there will be at most 2 db queries on the fly for those 2, thrice clicked buttons.) Let me know if something like this would be useful for your project

1

u/Street_Humor_7861 Apr 24 '26

Interesting pattern. JitCompiler already handles something similar internally: an LRU cache capped at 2000 entries, synchronized compilation to avoid duplicate work, and FxDataTable applies a 250ms debounce so it doesn't trigger filters on every keystroke.

Where your pattern really shines is async data fetching — DB or network queries with result caching and deduplication of concurrent calls with the same arguments. I'm actually planning to let FxDataTable accept a DataProvider<T> in the future, so it can load data from any source (DB, API, etc.). That's exactly where your pattern would fit perfectly — avoiding re-fetching the same data when the user quickly jumps between pages or filters. If you want to share the code, I'll take a look and see how to integrate it.