Jules Olléon
Jules Olléon

Reputation: 6888

How do "professionals" make a GUI in java?

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...

Upvotes: 19

Views: 25362

Answers (7)

Zack Angelo
Zack Angelo

Reputation: 423

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.

Upvotes: 1

Marcus Adams
Marcus Adams

Reputation: 53870

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.

Upvotes: 0

Fabio de Miranda
Fabio de Miranda

Reputation: 1096

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.

Upvotes: 1

stacker
stacker

Reputation: 68992

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)

Upvotes: 1

Uri
Uri

Reputation: 89839

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.

Upvotes: 1

extraneon
extraneon

Reputation: 23980

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.

Upvotes: 9

duffymo
duffymo

Reputation: 309008

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.

Upvotes: 4

Related Questions