If I'm writing a GUI application, which library should I use?

Seems that we have community-maintained swing and javafx bindings…

Is it the similar to “Which one should I choose - Swing or JavaFX” in Java?

P.S. If there are any other choices, plz tell me.

I generally use JavaFX as JavaFX, unwrapped. Fewer surprises, and you only have to look at one set of docs. (Using the Scala wrappers, you generally have to look at both the Scala docs and the Java docs for the underlying wrapped feature.)

1 Like

I use JavaFX directly, without wrappers. Because Java and Scala are interoperable, it is easier just to use JavaFX. I did this for a music notation editor, which has 72 Java files and 45 Scala files. The Scala files are traits and mixins to implement the main data structures in compositional form, and the Java files implement the musical object inspectors and basic GUI related classes (such as my ZoomPanPane). I use the Scene graph of Nodes, and not the Canvas, for display so that we get full resolution at all magnifications.

1 Like

Depending on what you want to achieve, you may prefer Swing over JavaFX. If I am not mistaken, even some big products (like IntelliJ IDE) use Swing.

While JavaFx is newer, it does not necessarily mean it is better in every respect. There are some things (like OpenGL rendering) which can be done only in Swing.

I prefer Swing personally. I mostly use Scala wrappers for Swing, but sometimes also raw Java swing. Your mileage may vary.