Posts Tagged ‘swing’

‘Fixing’ the slow JFileChooser on Windows XP

Friday, September 26th, 2008

Ever used a Java Swing app on Windows XP that seemed to freeze when you open a JFileChooser dialog? Apparently it’s caused by calls being made to Windows’ infamous integrated ‘compressed folders’ utility when files are recognized as archives.

The bad news is that every stable Sun JVM on Windows XP up to today suffers from this issue.
The good news that the issue has been f fixed in Java 1.6u10b07. Although I don’t presume to know the entire history of this bug, it seems a little sad to see this one was reported against release 1.4.2.

To fix on java versions predating 6u10b7, the only fix is effectively unregistering the zip folder dll from windows. Since I won’t quite use 6u10 until it’s GA and I’ve been a happy 7zip user on every OS I use for quite some time now I decided to go for the uninstall.

To unregister (and disable ‘Compressed Folders’):
regsvr32 /u %windir%\system32\zipfldr.dll

If you decide for some reason you can’t live without it and want to re-enable, execute again from a cmd :
regsvr32 zipfldr.dll

and you’ll be sending things to compressed folders before you know it :-)

JDK 6u10 early access features Nimbus Look ‘n Feel

Monday, April 7th, 2008

Although I found the Ocean look to be a major improvement of the Metal look and feel (L&F), Nimbus seems a big step forward once again. And not an unwelcome one at that.

It does deserve to be said that a project with a Swing frontend I’ve been working on for a client for sometime now has been running Ocean as default look for a while now. It’s primary user group are users with no technical expertise whatsoever, and after I disabled the native theme for a while to do some Vista testing and forgot to re-enable it later for the next release build, they’ve specifically asked me to switch back to Ocean afterwards when I had ‘corrected’ the issue. I still need to ask whether that was due to use of colors, font, dpi or messy Swing native theming.

Which brings up a question that crossed my mind a few times; how many or few colors can/should a business app gui use in it’s UI, before it gets that screaming feeling or transforms to the written equivalent of The Box Factory?

Since I try to adhere to splitting the layers and reusing components (sort of), the use of color seems pretty important when designing editors and viewers of different sorts. I suppose it should all be abstracted out to the presentation model right :-)

J2SE 1.5 Swing anti-aliasing

Sunday, October 14th, 2007

To make J2SE 1.5  use anti-aliased text by default it suffices to set the client property “swing.aatext” to “true”.

Got this from http://mindprod.com/jgloss/antialiasing.html