aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Swing are used nowadays in IT companies or not? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Swing are used nowadays in IT companies or not?" Watch "Swing are used nowadays in IT companies or not?" New topic
Author

Swing are used nowadays in IT companies or not?

ronney singh
Ranch Hand

Joined: Feb 10, 2012
Posts: 40

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.


Live Life King Size
Martin Vajsar
Sheriff

Joined: Aug 22, 2010
Posts: 3611
    
  60

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

Joined: Feb 10, 2012
Posts: 40

I corrected it.
Jay Orsaw
Ranch Hand

Joined: Jun 14, 2011
Posts: 356

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

Joined: May 03, 2008
Posts: 4664
    
    5

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.


luck, db
There are no new questions, but there may be new answers.
Jay Orsaw
Ranch Hand

Joined: Jun 14, 2011
Posts: 356

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

Joined: Jun 24, 2005
Posts: 500
    
    1

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

Joined: Jun 14, 2011
Posts: 356

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

Joined: Jun 24, 2005
Posts: 500
    
    1

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

Joined: May 03, 2008
Posts: 4664
    
    5

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

Joined: Jun 14, 2011
Posts: 356

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
Bartender

Joined: Oct 14, 2005
Posts: 18991
    
    8

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

Joined: Feb 10, 2012
Posts: 40

Thanks to you all for your responses.
So I got it that I will learn Swing first.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Swing are used nowadays in IT companies or not?