• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Swing are used nowadays in IT companies or not?

 
ronney singh
Ranch Hand
Posts: 40
IBM DB2 Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am reading Head First JAVA and there comes a chapter on GUI which is using Swing.
I heard a lot that swing are useless these days so I want to know that should I learn using Swing or not.
Will it be beneficial for me further.
 
Martin Vajsar
Sheriff
Posts: 3752
62
Chrome Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please note that the correct name is Swing, not Swings. Swing is a proper noun.

We have a Swing forum here which is quite busy, so you can see the technology is far from dead. I'll move your question there as it will get better attention from people interested in Swing.
 
ronney singh
Ranch Hand
Posts: 40
IBM DB2 Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I corrected it.
 
Jay Orsaw
Ranch Hand
Posts: 356
Android Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A lot of people will say a lot of things, Swing is used a lot and if you are going to use a GUI then it will either be Swing/AWT(older) or the new JavaFX.. It depends what you are trying to accomplish, but most everything uses a GUI and Swing is what you will most likely be using until JavaFX takes over(Which it is starting to since 2.0 has made a huge movement) and Oracle says that are stopping support on Swing(I believe so).
 
Darryl Burke
Bartender
Posts: 5125
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
AFAIK Oracle isn't stopping support for Swing. Swing has been declared to be in maintenance mode, which means bi new API, and the only changes to the code will be bug fixes. Not that Oracle or Sun before them have a great track record in fixing Swing bugs; there are some unresolved bugs that were reported more than 10 years ago.
 
Jay Orsaw
Ranch Hand
Posts: 356
Android Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah im not really sure there was a post on here about it and there was some conference where this was discussed. I would assume bug fixes would be continued, but yes no new api and fx is what they are focussed on. Fx is really awesome though cannot wait to see its future.
 
Claude Moore
Ranch Hand
Posts: 787
7
IBM DB2 Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just a question: it seems to me - after reading these posts- that FX will superseed swing. Did I understand well ?
Or is it a hasty conclusion?
 
Jay Orsaw
Ranch Hand
Posts: 356
Android Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Claude Moore wrote:Just a question: it seems to me - after reading these posts- that FX will superseed swing. Did I understand well ?
Or is it a hasty conclusion?


To my knowledge it's kind of like Swing superseding AWT(I believe). AWT has the old school look and Swing has the more modern look/feel. FX originally was a scripting language to my knowledge, but now it's becoming part of the Java Platform itself. Just by looking at the FX demo example I believe called (Encore) it shows extremely amazing ability and 3D capabilities. It's engine is much faster, and I hear stuff like file chooser calls are much faster. Overall I think FX will take over from Swing, but Swing will still be used, just like AWT is still available for use. Now there is a lot of talk(especially on this forum) about if people should goto FX right now or still use Swing. Swing is still the big boy IMO, and FX from 2.0(now 2.0.3) has shown BIG changes. IMO FX will come out on top, but when that is I'm not sure. People still say you should use Swing, but switching to FX now might be a good idea... I also hear that Swing/FX cannot be used together, but I'm not 100% sure on that, and I've only heard people say that, without any real evidence.
 
Claude Moore
Ranch Hand
Posts: 787
7
IBM DB2 Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for your explanation. Another question then... what about customizationof components ? With Swing is pretty easy to extend components' capabilities... will it be the same with Java Fx ?
 
Darryl Burke
Bartender
Posts: 5125
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
FX from 2.0(now 2.0.3)

2.1 is out: http://docs.oracle.com/javafx/release-documentation.html

FX will come out on top, but when that is I'm not sure.

At present, FX bindings can involve some horribly verbose code; that wil change drastically when Java 8 introduces closures.

I also hear that Swing/FX cannot be used together, but I'm not 100% sure on that

FX 1.x aka JavaFX Script allowed Swing components to be used in a JavaFX application. In 2.0, the situation is reversed: http://docs.oracle.com/javafx/2/swing/jfxpub-swing.htm

Coding for a mixed FX/Swing application is cumbersome, though, because of having to take care of thread safety in two separate GUI threads: the EDT and the Application thread. That can leads to the code being peppered with invokeLater/runLater. As a small example, here's a SSCCE I posted on another forum to illustrate interaction of Swing and FX components: http://www.java-forums.org/awt-swing/55491-sup-tag-doesnt-work-properly-2.html#post266518
 
Jay Orsaw
Ranch Hand
Posts: 356
Android Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Darryl Burke wrote:
FX from 2.0(now 2.0.3)

2.1 is out: http://docs.oracle.com/javafx/release-documentation.html

FX will come out on top, but when that is I'm not sure.

At present, FX bindings can involve some horribly verbose code; that wil change drastically when Java 8 introduces closures.

I also hear that Swing/FX cannot be used together, but I'm not 100% sure on that

FX 1.x aka JavaFX Script allowed Swing components to be used in a JavaFX application. In 2.0, the situation is reversed: http://docs.oracle.com/javafx/2/swing/jfxpub-swing.htm

Coding for a mixed FX/Swing application is cumbersome, though, because of having to take care of thread safety in two separate GUI threads: the EDT and the Application thread. That can leads to the code being peppered with invokeLater/runLater. As a small example, here's a SSCCE I posted on another forum to illustrate interaction of Swing and FX components: http://www.java-forums.org/awt-swing/55491-sup-tag-doesnt-work-properly-2.html#post266518


I had a feeling that there was another version ahead of 2.0.3, thanks Darryl. I'm glad that you can mix the 2, but yes I can understand the frustration of having to watch for thread safety and all that other bs .

and yes FX is still young, and they are still working on improvements, etc, but with Java 8/9 coming we will see major fixes for sure.
 
Paul Clapham
Sheriff
Posts: 21002
31
Eclipse IDE Firefox Browser MySQL Database
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also in response to the original question: learning Swing will force you to learn a number of programming techniques which would apply directly to Java FX programming. So even if you think that FX will take over from Swing at some time in the future, it's still a good idea to learn Swing.
 
ronney singh
Ranch Hand
Posts: 40
IBM DB2 Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks to you all for your responses.
So I got it that I will learn Swing first.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic