tags:

views:

524

answers:

7

Thanks for your answers to my previous question about GUI in java. I now wonder what are the solutions chosen by professionals to get a nice GUI, for "real" applications. Do you use swing and JComponents and just change the "look and feel" ? Do you prefer awt or another library ?

Sorry if that question sounds weird, I'm a student and I don't really know how java is used in the real world...

+2  A: 

I don't believe anyone prefers AWT anymore. Swing supplanted it entirely eleven years ago, building on top of it to correct flaws in the AWT 1.0 design.

Swing isn't the only way that professionals make Java UIs. That works for desktops, but there's also JavaFX now. For the web, UIs are built using HTML, CSS, JavaScript, and JSPs.

duffymo
For the love of God, please don't use AWT! Developing as a web-app has numerous advantages - not the least of which is easier deployment.
Stephen
@Stephen AWT GUIs and web-apps are totally different. It depends on what you're trying to do. Swing however has an advantage over AWT, although the AWT package is still used for event handling.
aduric
@aduric, I didn't intend to present them as the same. I was merely stating two things 1) awt GUIs suck, and 2) a web-app has numerous advantages. But, GUIs and web-apps aren't totally different, you can usually do most of what you'd want to do locally in a web-app.
Stephen
For the web GWT is also a great platform - especially if you already know Swing
Romain Hippeau
+3  A: 

In our company we use Swing, as that is supported by the JVM out of the box, but we do use color coded background colors for some panels and buttons.

If we'd use something different, like SWT or Jambi we'd also have to roll out those frameworks for all platforms, and test those frameworks for all OSses and (supported) java versions. Not nice at all.

It is however fairly tricky to create a nice responsive application with Swing; so you really need to use SwingWorker and the like. With a bit of experience however you can create a nice application that way.

And even if it isn't the fastest framework to develop in, development time is really small compared to defining the functional requirements of the user interface, and testing and support when the version is released.

That said, our target is desktops. If you target mobile devices or also need a web frontend your choices may vary.

extraneon
+1  A: 

My experience is that most organizations that want to create rich GUIs still use Swing, and manually go through all the annoyances of layout managers, etc.

The use of SWT is fairly limited to organizations that are using the Eclipse RCP as their platform. I'm not sure why it hasn't caught on outside this platform.

It's sad to admit, but Java Swing GUIs don't generally look good unless you spend a lot of time creating a more native feel for them. Even then, they often lose out on aesthetics to equivalent programs written specifically for Windows and which use Window APIs like WinForms.

Uri
You should try the GUI designer in Netbeans!
Thorbjørn Ravn Andersen
A: 

Macintosh OS X creates their own Java runtime. They give Swing components the same look and feel as native applications.

I use strictly Swing. I distribute "real" desktop applications via Web Start for both Mac and Windows that interface with the user's smart card reader.

The NetBeans IDE gives you a WYSIWYG way to create your forms. I've tried it out, and it's pretty neat, but we still use Eclipse as our IDE and design the forms in code.

Marcus Adams
The NetBeans WYSIWYG editor is a nightmare. If you can afford it, I'd recommend JFormDesigner, or just do it by hand with a layout manager. It may be more work at first, but in the long run you have more control.
cdmckay
Sorry, it isn't. You've got full control of what goes where and all properties and bindings and whatnot. You just have to know where to look.Btw.: as far as I know, MacOSX makes *AWT* look like macos aqua, not swing.
Tedil
Nightmare... Why?
Thorbjørn Ravn Andersen
@Tedil, I did some research, and it seems like Mac OS X makes both AWT and Swing look like Aqua. We definitely use Swing, and it definitely looks like Aqua.
Marcus Adams
+1  A: 

The most decent Apps I saw in the last years were build using Eclipse Rich Client Platform

Eclipse uses the Standard Widget Toolkit

and provides Graphical Editing Framework (GEF)

stacker
+1  A: 

We typically use Swing becuse it's supported in standard JREs out of the box. Normally we do the initial form design and event hookup in Netbeans and then export it to whatever we wish, Eclipse, for example.

Netbeans spits out pure Java using standard libraries (plus a jar or two you have to include) so it's no big deal designing the form in Netbeans and later moving on to something else.

Some people suggested doing form layout by hand using a layout manager. I see that as an option only if you are doing something big and very well budgeted that has to be maintained ad infinitum. Otherwise it's just too time consuming to be worth it.

Fabio de Miranda
A: 

We rely on SWT for our Java GUIs. Yes, you have to include an external native library, but the look and feel is native, more responsive (although Swing has become much faster in the past few years) and seamless with other apps on the target platform.

BigZig