3 ms·
I am making a simple image editor for myself to use on Linux, and honestly? After looking at different bindings for Qt and GTK on Go/Rust/Java and looking at ot
by graynk 5y ago
I am making a simple image editor for myself to use on Linux, and honestly? After looking at different bindings for Qt and GTK on Go/Rust/Java and looking at other GUI frameworks (all of which are in beta state, it seems) I went back to Java+JavaFX.
There's a decent GUI markup editor (Scene Builder).
There's no need to manually connect your handlers from XML markup to code - you can use annotations for that.
There's HiDPI scaling that you can override if need be.
There are Observable properties that you can bind to each other.
It's nice! Canvas and DrawingContext are a bit of a pain to use for my specific use-case, since it draws straight to buffer with no underlying Image, but I make do for now.
And you can take advantage of jlink to trim your JDK to modest sizes. There are also tools like Graal Native and Liberica Native Image Kit to compile your Java app down to binary, but I haven't toyed with those yet.
The cons are obvious: non-native look (you can try to style it with CSS, but there are no ready-made native looking solutions, I think, only different themes) and JVM startup time.
However, if you're willing to write C++, I'd argue Qt is the best choice right now. I just refuse to touch C/C++ with a ten-foot pole
- graynk 5y agoUPD: I checked out Graal Native. It was somewhat painful to make JavaFX work with it, due to reflective nature of the framework (which does not work very well with Java Modules), but I managed to make a native image with Gluon plugin for Maven. And it starts up FAST, I like the result. [0] - https://docs.gluonhq.com/#_gluonfx_plugin_for_maven https://docs.gluonhq.com/#_gluonfx_plugin_for_maven