Fog Creek Software
Discussion Board

specific problems with Java Swing UI

I noticed in Joel's booklist a mention
of problems he has with Sun's Java Swing

Anything specific that folks don't like
about it ??

(I work with Java Swing these days,
and find it quite serviceable, but would
love to hear other folks' thoughts ...)


Stan Krute
Monday, March 18, 2002

1) It's slow.

2) It's buggy.

3) It doesn't look and behave the same way as other Windows applications. 

And I say that as an engineer who got his current job because he knew Swing.

It's even worse when you try to apply the Windows look & feel.  Now you've got components who kind-of look like Windows components, but don't behave the way you expected them too.

Some of it is great -- Layout Managers rock my world -- but I'd rather work in .NET's Windows Forms, these days.


Monday, March 18, 2002

My thoughts: on a FAST system, it runs ACCEPTABLY. This is a box with lots of ram in my particular case.

Now, on slow systems, it's downright painful.

I use it for two reasons, however:

1) It's easy: learning to do anything major is relatively trivial. Compared to, say, the Win32 API....

2) Portability: I like writing small apps in linux and not worrying about moving it to a windows system.

Those two are the only advantages I can see, and I don't really think they are as important for commercial apps: I've done mostly quick hacks, and for that and being able to require 128mb ram, it works fine. But I wouldnt sell something like that :)

Mike Swieton
Monday, March 18, 2002

Heres a specific example:

The Open File dialog does not allow me go to a folder by typeing in a fully qualificied path.  If I want to access a network drive I have to map it first.

On our NT network I can't just type


when saving, and I will then be able to browse from that folder.

In Swings apps this is not possible.

I used to use an excellent Java editor called Jext, but this one little frustration made me have to look elsewhere because there just aren't enough drives mappings to go round.

Ged Byrne
Tuesday, March 19, 2002

I use it all the time too.  Apparently Swing in JDK 1.4 is much better performancewise than the previous releases, but I haven't tested it personally.

1.  Fonts render to different sizes on different platforms.  This is because Swing uses the native renderer on each system, presumably for performance.  Normally, people say it's not a problem if you stay away from null layouts, but there are times when you must simply use a fontsize conversion table.

2.  Sun gets in the way of a successful Java (and by extension Swing) all the damn time.  Swing *can* feel right on any platform.  Take a look at Mac OSX -- they worked closely with Apple, including giving them a consultant, and Java is integrated beautifully into that OS.

Should Sun work with the Beast in Redmond?  I don't know, but they also piss off the opensource community, who could have made it their best interest to create a great Windows L&F.  No doubt, it could be done so that the L&F could stay on its own platform to avoid legal issues.

Richard J.
Tuesday, March 19, 2002

To answer your Swing file chooser problem, use a FileDialog instead of a JFileChooser.  Yes, this is a peered AWT component, not Swing one, but it solves your problem. 

Timothy Falconer
Tuesday, March 19, 2002

On this Windows 2k workstation I run with 113% sized fonts (so I can read them), this screws Forte and Net Beans dialogs so that you have to aim half a line below the target to hit it, and if you resize the dialogs they snap the depth completely wrongly the other way.

I guess this is Swing that's at fault is there any fix?

Simon Lucy
Wednesday, March 20, 2002

Hmm, testing larger fonts out on Win98 had no adverse effects.  I will try to reproduce this when I get access to a Win2k machine, since this certainly impacts me.

Richard J
Wednesday, March 20, 2002

This is running at 1280 x 1024 setting to use large fonts (125%) has the same result.

Its a proportional bug so I guess 1024x800 and 800x600 will fit.

Simon Lucy
Thursday, March 21, 2002


Thanks for the tip.

Ged Byrne
Thursday, March 21, 2002

My problem seems worse using WindowBlinds to furkle with the windows skin, not using WindowBlinds improves things a lot but the basic problem remains. 

So it may well be that XP gives a similar problem though I'm staying away from XP as an OS.

Simon Lucy
Friday, March 22, 2002

*  Recent Topics

*  Fog Creek Home