tags:

views:

2045

answers:

16

Are Swing applications really used nowadays? I don't find a place where they are used. Is it okay to skip the AWT and Swing package (I learned a bit of the basics though)?

A: 

AWT I never actually learnt in full as swing is just a more sophisticated version, knowing swing is very important if you have any intention of ever making a Java GUI application.

Mark Davidson
will it be ever used for enterprise application development ?
arshad
+3  A: 

You should certainly write Swing for desktop Java, only using AWT to the degree that Swing demands it.

I'm sure people can come up with examples of very good Swing apps besides SQL Squirrel and IntelliJ.

I think that RIA technologies like Flex, Silverlight, etc. are ascendant because the web and services are taking mindshare from desktops. It's not just Swing that's losing out.

duffymo
"certainly", perhaps not, there is at least the SWT alternative (which I didn't learn).
PhiLho
I wouldn't consider SWT as a viable alternative, but that's my personal choice.
duffymo
+3  A: 

Swing applications are used in most cases where a Java app runs on the desktop. Sometimes you don't even know - for example, LimeWire is a Java Swing application.

When learning Swing, you'll find that you will come to know those parts of AWT that are still important, such as Event, LayoutManager, Graphics, Font, Color, etc.

David
azureus was developed in swing ? wow .. thanks for the info pal :)
arshad
I believe that Azureus uses SWT toolkit (from of Eclipse), not Swing.
Peter Štibraný
Yes, Azureus is an Eclipse RCP, i.e. it uses SWT.
JesperE
OK, edited my answer to fix that. Sorry for the mistake.
David
I tend to agree. You won't even realize you're running Swing apps when they're done right. Unless you really look, there's no way to tell our app (http://www.landlordmax.com) is a Swing app.
Stephane Grenier
+5  A: 

Swing is heavily used in business specific (vertical)/internal application development.

Brian Knoblauch
+5  A: 

Hmmmm... how about NetBeans? You know, the IDE? It uses Swing.

Ubersoldat
ya i know and also eclipse
arshad
While Eclipse is great IDE, it doesn't use Swing, but SWT.
Peter Štibraný
oh thanks for the info
arshad
+2  A: 

Check out Filthy Rich Clients. It explains some of the history of AWT and Swing. Swing, being a lightweight alternative (successor) to most of the AWT classes.

Martin OConnor
+2  A: 

Skip AWT and Swing? To jump where? SWT? Web-based development?

In the broader sense, I have a number of Java applications, although I am not too sure if they use Swing or SWT.

  • Lot of database tools like SQuirreL SQL Client are written in Java. I think SQuirrel uses stuff from Netbean, which is, of course, Swing based.
  • yEd is written in Java, probably Swing.
  • A number of P2P softwares are written in Java, including Frostwire (I see no trace of SWT there, but I can just miss it).

And this list is far from exhaustive!

Lol! I forgot to mention the software suite made by the company I work for! It is quite specialized, used by mobile phone companies to monitor health of their network nodes (superficially looks like a spreadsheet). Totally Swing based.

PhiLho
Open Office is *not* written in Java (it's slow for other reasons ;)).
Dan Dyer
Ah? Somebody already told me, but before posting, I checked and found lot of jar files (in program/classes). It has lot of DLL and exe files too, indeed. Confusing, at least.
PhiLho
OpenOffice is written in C++ and supports Java plug-ins somehow.
Rastislav Komara
+12  A: 

If you are writing for the web exclusively, you can probably skip Swing, but otherwise you're absolutely going to run into it. I've never worked on a non-trivial Java app without a Swing GUI.

Also, Swing is one of the better APIs to use. If you use most others, you are going to find them more difficult to use and/or platform incompatible. (If anyone reading this is aware of exceptions to this, please leave comments, I haven't looked for a while and am kind of curious if anything better has become available)

Other JVM languages like JRuby and Jython are often used because of their access to Swing.

Bill K
+2  A: 

Whenever you want to write a desktop GUI app for non-Windows OS, you use Swing as the only sane and guaranteed cross-platform GUI framework.

Besides, Swing has a very good design. I recommend to learn it anyways, to make yourself a better programmer.

Yoni Roit
A: 

There is no universal question to whether it is ok to skip something or not. It's a matter of priorities. While Swing has a lot to teach you (and it is too heavily infused with AWT), if you're never going to be writing GUIs you may be better off investing in something else.

Swing, while ugly as hell, is still used in many places. A quick search on "java swing" in Indeed or dice would reveal many jobs and industries that require it.

Uri
Swing, while not great in many ways, is far from "ugly as hell". It has many nice concepts, and is quite good to use after a bit of experience is gained. And with recent font improvements makes it quite possible to write a GUI which is indistinguishable from a native app.
Software Monkey
Indistinguishable, except that it resizes properly, that is.
Software Monkey
i find that the file choosers are very slow in swing - i hate them
arshad
You can write something pretty in every language, but in my experience the vast majority of applications written with similar effort in Swing compared to other APIs tend to be clunkier, less aesthetic, and less robust.
Uri
I always put the following right at the top of my `main` method to reduce the ugly-ness: `UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());` (with the necessary try/catch). It's still not as beautiful as you might want it to be, but it helps a lot.
MatrixFrog
A: 

Are you skipping it for an exam/interview? Besides really good apps like IntelliJ IDEA and NetBeans, there are lots of Swing like frameworks [SWT (Eclipse), GWT etc.] which you can learn faster with Swing knowledge...

Sathish
+2  A: 

IIRC jEdit is also a Swing app. Quite a popular text editor.

utku_karatas
+10  A: 

You may checkout Swing Sightings.

This website is hosted by SUN and it is dedicated to sw projects that use Swing. There are a lot of projects using Swing ...

http://java.sun.com/products/jfc/tsc/sightings/

While I don't doubt Swing has it's place even today (and at the same time being an ugly and complex beast to get started with), the last sightings issue is from 2005 - so it cannot really prove that Swing is used _today_ ;)
Henning
LandlordMax (http://www.LandlordMax.com) is a current desktop application that's based on Swing. I can assure you the Swing community is very alive! FYI: It was feature on Swing Sightings years ago.
Stephane Grenier
A: 

You should probably be looking at JavaFX for future work. As the FAQ states,

Sun is not replacing Swing with JavaFX Script. Instead, JavaFX Script makes Swing easier to use.

Using/learning it will give you a very good understanding of the important Swing concepts, and how they fit in with "the future". I haven't used JavaFX yet, but heard very good things about it.

Stephen
A: 

Geertjan Wielenga often blogs about applications based on the NetBeans platform, and therefore Swing. The applications range across the board from rather small esoteric applications to very large, mission-critical systems (Boeing Aircraft comes to mind). Many of the enterprise-level applications that Geertjan misses are mentioned on Planet NetBeans. It seems like every few weeks there is an announcement or description of such a program.

As noted above, lots of tools use Swing including the IntelliJ IDEA IDE, a favorite. I'm surprised no one else mentioned it.

Sun also used to maintain a Swing Sightings web site, but it hasn't been updated in a few years.

Where I work, Swing is used in the presentation layer for a very large document management system. In my own development experience I've used Swing for desktop applications in the areas of image processing, device control (video, motors, etc.), math, statistics, and medical devices.

BTW, I agree about the slowness of file choosers. But there are lots of alternatives that will use the native file chooser. It can just be a bit jarring if the L&F's don't match up very well.

EDIT: Oh, and as others have mentioned, it's very easy to use Swing from other languages on the JVM. With Clojure, for example, it is even easier to use than in Java, in my opinion.

clartaq
A: 

While Swing has some cross-platform look-and-feel deficiencies and it would be nice if it was updated to support generics, it is still well designed and quite usable. I have always been a fan of the sheer amount of customization offered. SWT is nice and is more native, but you give up some power and control with that as well. In addition, it seems simpler to use, which can be a plus, since Swing can be overly complex due to its flexibility.

Matt