Fog Creek Software
Discussion Board




Correctly developed Swing application

Every time someone complains about Swing, a couple of voices pop up from the crowd and say that it's great, developers are the ones who don't know how to develop with Swing.
Now, I dowloaded Share from clevercactus, I downloaded JDiskReport from JGoodies and at work I use a Swing SAP client. All these applications look good, are extremelly responsive and were developed in Swing.

Does anyone know of any well developed open-source Swing  applications? Something you know works very well, developed the way Swing applications should be developed. I need to read some source code to see how it's done.

Ogami Itto
Wednesday, August 25, 2004

What I find funny is that nobody finds this to be a problem? 

"developers are the ones who don't know how to develop with Swing."

Doesn't this seem to proclaim that there is something wrong with your GUI framework when 75% of developers don't know how to use it correctly?  For whatever reason even the horribleness of Win32 has less issues than Swing in this regard.

Almost Anonymous
Wednesday, August 25, 2004

When I used to do Java, I always checked the "Swing Sightings":
http://java.sun.com/products/jfc/tsc/sightings/

And the Swing apps that are well developed, I guess, require experience and/or amount of hands/eyes.  And maybe, a couple of extra bucks to buy a nice look&feel.

Cheers

Dewd
Wednesday, August 25, 2004

By well developed do you mean the slickness of the UI or the internals? It sounds to me you are looking for examples of the latter although everyone has a different interpretation of what well developed is.

Maybe you could have a trawl around freshmeat or sourceforge.

TheGeezer
Wednesday, August 25, 2004

I'd consider Manning's book Swing. I don't know if it's outdated; just mentioning it since it stepped through the development of apps, building on layers, with complete sourcecode.

The argument that "people are using Swing wrong" is interesting. There's a bit of kool-aid in that argument, but there's a lot of truth too. Java is aimed at a mainstream programmer market, so the argument is plausible. People will plug up the event handlers without knowing invokeLater tricks.

Memory was always an issue, though maybe that's changed recently. When people think "performance," they think speed and forget memory. This leads to problems with multiple Swing apps running when users don't have enough RAM.

Tayssir John Gabbour
Wednesday, August 25, 2004

I think the most common problem is doing real
work in callbacks instead of queing work to
another thread for later processing.

I would agree that swing should assume people
will screw this up and make async behaviour the
default.

The problem is threading is in java is too hard
and swing suffers.

fourth place
Thursday, August 26, 2004

Performance-wise, jEdit text area syntax highlighting etc has always compared nicely against Eclipse (= SWT because 'swing' is perceived as slow), and yet jEdit is 100% swing.

With the (free) look&feels (there is even a plugin to make l&f selection easy) it looks great too.

i like i
Thursday, August 26, 2004

> For whatever reason even the horribleness of Win32 has less issues than Swing in this regard

Maybe because code accessing Win32 tends to be native code rather than having a VM in the way, so the "horribleness" isn't externally noticable.


Thursday, August 26, 2004

I'm a long time swing developer. I like swing, it's quite powerful, and although I like the idea of swt, I think it will be a while before it catches up to the power and flexibility of swing.

Nonetheless,  I tend to agree that just about any other advanced GUI toolkit out there (I'm thinking mainly VB, MFC, etc) gives you a much better chance of developing a native looking (and feeling) application and at a much much reduced development time compared with swing.

I work on an application that uses just about every main widget in the swing toolkit, and I dont think there is a single one that we haven't had to heavily customize to use well.

Then with every release of the swing toolkit we have to rework all of our customizations to match incompatible changes.

Swing would be a lot better if the team spent one or two big releases just simplifying things and fixing bugs - with no new features.
(Yes of course, as Joel will say - and has said - an ISV with need for a measurable profit margin cannot afford a product release with no new features - but the swing team isn't in that category)

Having said that, a couple of other Swing apps (not -free) with truly professional UIs that come to mind are:
- IntelliJ IDEA
- Bugseeker 2

Perhaps its telling that they're both developer tools.
As Joel has written - you can't really walk into Best Buy and pick a java/swing app off the shelf in a shrink-wrapped box.

(Then again you can't do that for FogBUGZ or CityDesk either ;)

swinger
Thursday, August 26, 2004

Just to clear up what I want:
I have developed with Swing, and I love the way it's built. But everytime my applications hit a certain load, they become unmanageable. I tried threading, but as a previous poster said, it's not enough. After many discussions, I need to know. What is the best way to develop a Swing application? I know Sourceforge has tons of them, but how can I tell they're just as good as the apps I do?

So, I ask thee, dear forum habituées, what are the best opensource Swing apps you've seen?

Ogami Itto
Thursday, August 26, 2004

>Doesn't this seem to proclaim that there is something wrong with your GUI framework when 75% of developers don't know how to use it correctly?  For whatever reason even the horribleness of Win32 has less issues than Swing in this regard.

Swing is fairly easy to get started with compared to Win32.  So more do with the people doing it rather than the technology, hence the OP's question.

Bill Rushmore
Thursday, August 26, 2004

I don't know of a good Swing open source app, but, then again I don't really look.  I love Swing.  I think it's one of those things that you either get and take advantage of, or don't and hate.  Swing performance is not as good as native widgets but Swing now is as good as native performance, say five years ago and I don't recall everyone bitching about native performance back then.

I doubt that looking at an open source app will help much because the optimization of each application will be different.  You need to use threading (as you have done) and you then need to look at your models and optimize those for heavy loads.  Not writing your own models?  That's a problem right there.

name withheld out of cowardice
Thursday, August 26, 2004

> Not writing your own models?  That's a problem right there.
Care to explain? What models?

Ogami Itto
Thursday, August 26, 2004

netbeans (netbeans.org) - I think it's F/OSS.  A very usable Java, et al, IDE written in Swing.

UT2004
Thursday, August 26, 2004

Actually it isn't that great. It's quite heave and until recent versions it was poorly designed.

But, since I said "until recent versions" I guess I'll have to look at more recent versions.

Ogami Itto
Thursday, August 26, 2004

Writing one's own models:
Swing uses a Model View Controller motif for many of its components.  For every JTable there is a TabeleModel that it reads to know what to draw and where.  Likewise for every JTree there is a TreeModel to be queried.  Same for JList etc.

The default way to use these components allows you to supply, for example, a Vector or array to populate a JList and the default implementation knows how to handle this.  This works fine for simple cases but as your application becomes complex (as it sounds like yours has) you will realize performance improvements from supplying your own classes that implement, in the case of a JList, ListModel.  You can optimize these models using knowledge of your needs that the Swing team simply would not.

In many cases you might also want to create a custom Renderer and/or Editor for your components.

In the case of models and renderer/editors the standard java optimization advice holds- minimize new object creation, use caching to memory to avoid excessive disk reads and network reads.

name withheld out of cowardice
Thursday, August 26, 2004

Swing rox. But I use SWT.

fool for python
Friday, August 27, 2004

High Perf GUIs with Swing:

http://java.sun.com/developer/community/chat/JavaLive/2003/jl0121.html

Nice app : myPod (http://mypod.sourceforge.net)

RedFox
Friday, August 27, 2004

*  Recent Topics

*  Fog Creek Home