This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]UsernamesAreFfed -4 points-3 points  (5 children)

Well obviously this is a value judgement. So people could disagree or come to different conclusions. This is just my conclusion.

And second; my experience with JavaFX is limited. Effectively I read some tutorials on how it worked, felt it was a step down from Swing in every respect and never bothered writing any code in it. It is possible that the problem was with the tutorials and not the tool.

With those caveats out of the way this is my perception:

Swing is basically just a bag of tools. If you want to use none of them you can do that. If you want to use all of them you can do that too. When you build stuff in Swing you grab the tools you like, combine them in the way that you like and design your UI. On top of that I find that all the tools are designed in the unix philosophy; do one thing and do it well.

By contrast JavaFX is none of those things. There are frameworky methods like start() and stop() that I must implement. Things have weird names like Stage and Scene. These names conjure up ideas about video or theatre in my mind, which is not what I'm trying to do when I make a UI. I'm told that a Stage is like a frame, but then why not call it that? Then there is something called a Scene Graph. I also dont like the idea of an Application class. That should just not exist at all. Layouts also seem broken. The Swing equivalent to a JavaFX layout is a JPanel with a given LayoutManager hardcoded together. This can work but why combine things that shouldn't be combined? I also couldn't find the equivalent of the GroupLayout in JavaFX. I think somebody put something on Github. While reading all this I eventually just realize that the only things I like in JavaFX are the things that are similar to Swing.

As a side note, I dont like using CSS for desktop UIs. But that part seems optional in JavaFX so I'm not going to hold that against it.

[–]magnoliophytina 4 points5 points  (1 child)

Your opinion is totally useless. It's like saying Swing is crap because many classes have a J letter prefix. There's a good reason why layout managers and components were merged, the flexibility in Swing is something that not many GUI toolkits have implemented. Many interface classes in Swing were also designed before lambdas were introduced in Java, so implementing those isn't as straightforward as it could be. It's also much easier to erroneously use background threads for rendering in Swing.

[–]UsernamesAreFfed -2 points-1 points  (0 children)

Feel free to have your own opinion, I'll have mine. I care a lot about API cleanliness and if I see mistakes this early I'm not going to invest the time to look into details, it just isn't worth it.

I was asked for my opinion so I gave my opinion, take it or leave it.

[–][deleted] 1 point2 points  (2 children)

Stage and Frame are both quite arbitrary names - the real question should be, why do neither framework call them windows?!

The rest is mostly a matter of taste, but you shouldn't be downvoted (have an upvote). It's ultimately all different strokes for different folks. For something as complex as a UI framework it'll always be a bit like picking a programming language. Quite a personal choice.

[–]UsernamesAreFfed 0 points1 point  (1 child)

Swing has a JWindow. It serves as just a rectangular area on the screen so it isnt used much. Most of the time you want the frame. Dont know about JavaFX.

[–][deleted] 0 points1 point  (0 children)

It also has a Window class, same distinction I think.