-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question or perhaps Documentation] SWT versus JavaFX #1
Comments
I'm surprised you ask this question since the project page includes a Glimmer DSL Comparison Table that explains everything: Glimmer DSL Comparison Table:
Also, I explain in the Glimmer DSL for Swing project the reason why Glimmer originally supported SWT:
In summary, SWT supports native widgets that have the real look and feel of every platform it runs on (Mac, Windows, and Linux) just like the original widgets you get if you write your desktop applications using Mac Cocoa with Swift/Objective-C on Mac, MFC C++ on Windows, and GTK on Linux. This is also what LibUI aspires to do in fact, but in C instead of Java. JavaFX is just like Swing (but supports newer APIs) in the sense that it renders its own non-native widgets that do not have the real look and feel of every platform it runs on unless you apply themes, which will go out of date if operating systems update their look and feel. Also, JavaFX widgets just like Swing widgets are suspect to Java garbage collection pauses, unlike SWT widgets, which are not garbage collected by Java (they are natively implemented in C++/OS-language and wrapped by Java), so they do not suffer from any pauses even when the garbage collector is triggered. In conclusion, SWT enables building better looking desktop applications with better performance. Swing and JavaFX on the other hand provide a way to build cross-platform applications, but do not provide a native look and feel out of the box, and might suffer from performance issues. That is why Glimmer DSL for SWT is the most supported and complete JRuby desktop GUI Glimmer DSL. However, I recently built small Glimmer DSLs for Swing and JavaFX just because I had extra time on my hand late last year. I also figured people learning Swing and JavaFX in Java will end up liking Glimmer more than coding in Java, and that would then excite them to check out other Glimmer DSLs like Glimmer DSL for SWT and Glimmer DSL for LibUI. I would advise you not to waste your time learning Swing and JavaFX. Learn SWT instead since it is better anyways, and has the biggest support by Glimmer. I assure you that you won't regret the time you put into learning Glimmer DSL for SWT. It is the best Ruby library for building desktop applications today, and competing libraries don't even come close to what it supports and provides. Also, if you've used Glimmer DSL for LibUI before, you almost already know Glimmer DSL for SWT, but I recommend you go into the Project Samples. It's very easy to get through them (especially when following the YouTube videos from within the Glimmer Meta-Sample), and your Glimmer DSL for SWT knowledge will multiply greatly and very fast as a result. |
I forgot to answer this question earlier:
Such games (Snake, Tetris, Tic Tac Toe) could certainly be developed with glimmer-dsl-jfx as it supports custom 2D graphics as demonstrated by the Hello, Shapes! sample: https://github.com/AndyObtiva/glimmer-dsl-jfx#hello-shapes I'll create issues for building those games and link them to this one. Thanks for asking. |
Heya Andy,
This is more a question or perhaps it could be added to the README, if
someone else may find that question interesting.
Today I got my first JavaFX in pure Java to work. \o/
So now I am learning more about JavaFX. I was already using Swing
for a little while. It wasn't very pretty.
Anyway. If you have time and motivation, could you perhaps describe
a bit why people may prefer SWT over JavaFX or vice versa? Is
SWT better? I think you put more time into the glimmer-SWT than
JavaFX so perhaps there is a reason. Or it was just chance or
random.
Also, do games such as snake or tetris or tic-tac-toe work on the
glimmer-dsl-jfx? I tried to find tetris here but could not find it,
whereas on SWT it is under https://github.com/AndyObtiva/glimmer-dsl-swt#tetris
Anyway, these are mostly questions. I myself don't know SWT and
am a JavaFX noob so I don't really know any differences. Perhaps
I get to play around with jruby more but I only tested jruby with
swing so far - not quite sure how to use either SWT or JavaFX
with it (it is probably very easy, but one has to first understand
what is going on really and I am not quite at that point yet; I
was lucky enough to finally understand the commandline syntax
for telling javac where it can find the JavaFX code/JAR files).
The text was updated successfully, but these errors were encountered: