Which Look and Feel Should be Default in Java 7?
The other day I was discussing with colleagues if Nimbus should be the default LAF(Look and Feel) for Swing applications. The current default LAF is Ocean which is a spiced up theme for Metal which has been the Swing default LAF since the beginning.
It feels like with a large release like Java 7 it is about time we changed the default LAF to a more sensible choice which leaves two choices Nimbus which is the new cross platform LAF and the system native LAF which will be Windows LAF on Windows and GTK LAF on Unix. A
pple has already gone with the system native choice and the default LAF for Java Swing applications on Mac is Apple’s Aqua native LAF. The only reason for remaining with Ocean LAF is to maintain backwards compatibility for old Java applications which were written with static pixel based layout so will be all messed up if the size of components changes.
My feeling is that sector of users should be getting pretty small now and as long as we provide a easy work around like system property file that lets a user/administrator change the default LAF back to Ocean for those few special cases then we can move forward and select a modern LAF as the default. So then it comes down to what to choose Nimbus or Native(Windows/GTK) I am torn between the two. So we decided the best idea is to ask more people, so what do you think? Come and vote at our Poll
(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)










Comments
Ryan de Laplante replied on Tue, 2009/03/17 - 7:40am
Robert Greathouse replied on Tue, 2009/03/17 - 8:01am
Andrew McVeigh replied on Tue, 2009/03/17 - 8:28am
in response to: rdelaplante
trouble is that the native LnF, particularly on Linux/GTK is pretty awful. Only works correctly without generating lots of resource warnings on the default theme. Plus, menus do not have any borders.
Even nimbus gives problems on Linux. I find that drop-down jcombos regularly crash this LnF under Ubuntu (I don't know about others).
How about JTattoo (www.jtattoo.net) for a default ;-) That looks great and I've never seen it go wrong under any OS.
Andrew
Mark Haniford replied on Tue, 2009/03/17 - 9:49am
trouble is that the native LnF, particularly on Linux/GTK is pretty awful. Only works correctly without generating lots of resource warnings on the default theme. Plus, menus do not have any borders.
It's not really trouble because Windows is the dominant desktop, and they finally got Swing looking good on it. Native L&F should obviously be the default, but I expect Sun to once again make the wrong decision.
Developer Dude replied on Tue, 2009/03/17 - 10:50am
Andrew McVeigh replied on Tue, 2009/03/17 - 10:53am
in response to: greathr
It's a good question. I bought a super-whizzbang alarm clock the other day that can download sleep patterns via USB into a slick GUI. Anyway, to cut a long story short, I was thinking to myself "they've made the GUI look really nice, sort of a bit like some of the Sony stuff I've used before".
And then I realised that it was simply the WhiteVision Synthetica look and feel running via a Java Swing GUI. I know this LnF well as I've previously purchased and used it. However, i guess I wasn't thinking about being a programmer just at that point, and as a consumer just thought that it looked like some slick windows app... It made me wonder if we apply different criteria to Java GUI apps, simply because we lose perspective on what the end user thinks.
Pictures of the actual GUI are in this pdf: http://www.axbo.com.ua/files/aXbo_research_ukr.pdf
Here's a webstart of it: http://www.axbo.com/webstart/aXbo.jnlp
(It doesn't do a lot though if you don't have one of the clocks ;-)
The app worked like a dream. Ironically however, it was limited to Mac and Windows (probably because of device drivers) :-(
Andrew McVeigh replied on Tue, 2009/03/17 - 10:55am
in response to: mark haniford
Well, it's trouble for non-Windows users, and violates the spirit of WORA. If they make the native LnF the default, they have some Linux work to do.
Andrew McVeigh replied on Tue, 2009/03/17 - 11:00am
in response to: andrewm
Whoops, I spoke too soon. I plugged the clock into my linux machine, started up the webstart app, and it all works flawlessly under Ubuntu. Cross platform lives on!
Andrew
Sergey Surikov replied on Tue, 2009/03/17 - 11:45am
There are no "native" GUI. All realy pretty applications has own LAF
Mark Haniford replied on Tue, 2009/03/17 - 11:47am
in response to: andrewm
Andrew McVeigh replied on Tue, 2009/03/17 - 12:06pm
in response to: mark haniford
Well, Java 1.5 looks fine with Quaqua under the Mac. as for 1.6 and SoyLatte, I think we can all agree it doesn't look fine.
Mike P(Okidoky) replied on Tue, 2009/03/17 - 12:14pm
Take no risks! Leave it what it is by default. Java right now is one of the, if not the, most portable WORA platform there is. Don't mess with that ! ! !
However, isn't there a prefernce setting you can define in the jcontrol panel? I briefly googled around to see what setting that is, but couln't immediately find it. Anyone know?
Andrew McVeigh replied on Tue, 2009/03/17 - 12:21pm
in response to: okidoky
swing.defaultlaf=com.sun.java.swing.plaf.windows.WindowsLookAndFeel
so you can probably add this to the java runtime flags in jcontrol via -D.
Ivan replied on Tue, 2009/03/17 - 1:00pm
JeffS replied on Tue, 2009/03/17 - 4:22pm
Nimbus has my vote. It looks very slick and modern and comfortable. To me, Nimbus is a big improvement over Ocean. And I agree that their should be a configuration in the Java control panel that allows the user to tell apps to be Ocean by default, if need be (in those rare cases where Nimbus doesn't work right with a legacy app).
I think native LAF is way overrated. Most of the biggest commercial destkop apps typically don't maintain complete native LAF. Even with Windows, Microsoft's own desktop apps don't maintain complete native LAF, and native LAF has a lot different connotations. So long as it looks good, and behaves well (particularly meeting end users behaviorial expectations), it's fine.
I think only developers obsess over native LAF. Most end users couldn't care less. Again, so many popular desktop apps have many different LAFs. It can actually be a competitive advantage for ISVs to make their desktop apps have their own unique, cool LAF. Most people do not expect applications to blend 100% with the native environment.
Personally, I alwasy configure a Swing app to have Nimbus LAF, if it's possible with the app in question. I've done so with Netbeans, jEdit, and Makagiga. Also, any Swing apps I write, I prefer Nimbus.
Developer Dude replied on Tue, 2009/03/17 - 4:57pm
If it was up to devs they would pick some whiz bang L&F they prefer (personally, I would emulate Aqua on every platform if I was the only user).
A lot of Swing apps are intranet or vertical market business apps where the user doesn't really care what you developed the app in, just that it does what is needed and looks and feels like the rest of their apps. One of the biggest complaints I have heard about Safari and iTunes on Windows was that they used the OSX L&F.
As for big companies getting away with non-standard L&Fs: I don't work for those companies and my apps need to conform to user expectations, not drag users along kicking and screaming because I can (I can't - I'm not Microsoft, or Adobe, or Apple).
Standardization on a platform is important whether you are MS or Adobe or some small dev company - users need to get work done, not learn some new paradigm (I hate the new MS Office L&F, it adds nothing to my productivity - indeed, I am always hunting around for something that I used to know right where to find it).
Sergey Surikov replied on Wed, 2009/03/18 - 12:14am
in response to: Developer Dude
Developer Dude replied on Wed, 2009/03/18 - 11:55am
in response to: surikov
All I am saying is the default should be native not that the L&F must be native. Standard app devs (those who write biz apps, which are the majority of Java Swing apps, although they may each only have a few dozen to a few thousand users) should try to be as faithful to the native L&F for a platform as possible as that is generally what their users expect. Look & Feel and behavior should be familiar to the user, not a jarringly different experience every-time they use an app just because the dev or the PM preferred some non-standard L&F over the native L&F. If some component is different, then there should be a very good justification for that difference, not just a matter of taste.
There are other classes of apps where a non-standard L&F is okay (multi-media apps, etc.), but not most apps. It it is up to the dev - changing the L&F is not that hard if you chose it from the beginning.
Wong replied on Thu, 2009/03/19 - 9:15pm
Milind Rao replied on Fri, 2009/03/20 - 2:18am
Also, I have been waiting for the tools to change Nimbus properties and icons. But this focus on JavaFX and the loss of senior Java Developers in the Swing group has really damaged Swing progress over the last 2 years. I had great hopes for client Java after the 2005 and 2006 JavaOnes. The new plugin is excellent. But Swing itself has seen no progress at all in the last two years. A few projects started and just dropped. Very disappointing.
Karsten Silz replied on Sat, 2009/03/21 - 4:06pm
in response to: Developer Dude