views:

460

answers:

5

Hello

In my current project we have to develop a good looking desktop based application in java.

Currently, we have a very basic desktop application written in swing and team does not have good swing knowledge. Can we create a very good looking UI in swing?

Should we use JavaFX for creating the desktop application?

What are other alternatives to do this?

Thanks

Shekhar

+1  A: 
aioobe
+7  A: 

Swing is very flexible with regards to look-and-feel and you can certainly make very good looking applications with Swing.

I recommend the book Filthy Rich Clients by Chet Haase and Romain Guy if you want to learn how to make nice Swing GUI applications.

Jesper
+1 for mentioning Filthy Rich Clients. There's no better book for understanding the intricacies of Swing.
Herminator
+2  A: 

You can certainly create great looking UI's in Swing - applications such as NetBeans and IntelliJ IDEA have proved this amongst many others.

The only alternative Swing has is SWT(Eclipses toolkit), however it's not portable as Swing and not as flexible as well. It offers, however, faster performance and the use of native components, which might be what some people actually want.

There are Java bindings for most existing GUI toolkits as well - for example Java for Gnome and someone might find them interesting.

I however favour Swing's extreme portability, MVC adoption, pluggable look and feels, availability of lots of third party libraries with additional components(SwingX, JIDE, ...) and ease of use.

Btw for optimal results in Swing, choosing a good layout manager is essential - I recommend you to have a look at the almighty MiG layout.

Bozhidar Batsov
+2  A: 

Check out http://www.pushing-pixels.org/. Kirill is the author of Substance which provides a ton of new look and feel options for Swing. Here's a blog entry which shows a little bit of what is possible with Swing. There used to be a link to his 2007 presentation at Java One, but unfortunately the link no longer works.

Herminator
A: 

From you answer its not very clear what your problem is. A simple, but often sufficent solution is to change the look and feel for you application to the Systems default look an feel (so Swing looks just like a native application). All you need to do is insert the following code somewhere before any of your UI is created/shown (if you don't know where, place it as the first in your main-method):

try {
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception e) {
// exit application, log  or ignore exception
}
Durandal