Hello, i just wanted your input on something with regards to java. Would it be good to use javafx for my user interface, or would sticking to swing be easier or more convenient? I'm still a student by the way, so i'm not really thinking in terms of the enterprise yet.
I think that using JavaFX will be more difficult due to the relative lack of documentation, tutorials, examples etc. Furthermore, I would say that JavaFX assumes a little bit of pre-familiarity with Swing, for example the event model (ActionListener
s etc) and the event-dispatch thread.
There's 10 years worth of Swing resources and libraries out there on the internet.
there is several issues with JavaFX which Swing already solved. Also, it is really young technology making baby-steps. I suggest to consider all aspects. Both has pros and cons. Swing has a lot of resources. JavaFX is simpler in dealing with RIA kind of interfaces. So try both, and decide based on gained experience. But the JavaFX is worth of your time.
JavaFX is worth it if you are willing to ignore the problems of it being a young technology. It has a lot of potential though, so I suggest you try it out over Swing if there is no time constraints.
Points to consider:
- JavaFX is young, so it won't have as much documentation. However, depending on what you're doing, it's much easier to use. For instance: to add a click handler to any node, just add
onMouseClicked: myfunction(e:MouseEvent)
in the declaration. You will have more examples for Swing, though. - It's much easier to start with JavaFX than to bring it in later. You don't have to worry about this since you are a student.
- JavaFX has gained popularity significantly since its 1.2 release. It still is not mainstream but might be a good technology to invest yourself in for the future (thinking mobile phones)
Since you're a student, I'd personally have to say JavaFX. Sure it's harder to get started, but I think it'll pay off with it's relative simplicity compared to Swing later.