The Source for Java Technology Collaboration
User: Password:



Hans Muller's Blog

October 2005 Archives


Official: Swing is the Dominant GUI Toolkit

Posted by hansmuller on October 18, 2005 at 12:31 PM | Permalink | Comments (33)

I've been trying to think of a way to humbly announce that no lesser authority than Evans Data Corporation has reported that Swing is the dominant GUI Toolkit for Northern American developers. It's difficult to present this new statistic with the grace and humility of good sportsmanship because, after nearly 8 years of steady growth:

"Java Swing with 47% use, has surpassed WinForms as the dominant GUI development toolkit, an increase of 27% since fall 2004."

That's a direct quote from the Spring 2005 report. You may want to read it again (I have). There are more developers building applications using Swing and Java SE than WinForms and .NET. Despite the titanic resources marshalled by Microsoft to assert dominance over their own desktop platform, the Swing community has grown into an unstoppable force. Microsoft has often been referred to as an "eight hundred pound gorilla". Thanks to the persistence and enthusiasm of Swing developers everywhere, we've thrown the gorilla and the cage off the island. We're the new alpha male, we're the King Kong of GUI toolkits. We are the force to be reckoned with. We are number one!.

I realize that was a little over the top. I'm supposed to be humble and quietly confident about our success and not indulge in all of this vulgar gloating and boasting and jumping up and down on the desk shouting, we're number one, we're number one, we're number ...

Sorry about that.

I'll just remain calm from here on in. You'll have to trust me when I say that I'm reporting the following from a peaceful and serene perspective. The use of both Swing and AWT have grown dramatically in the last year and, quoting from the report, "Java GUI development is clearly experiencing substantial growth". So it is. I would guess that there are at least two trends at work here. People are writing Swing clients to augment or replace browser clients for network services, and developers really do care about platform portability. Sometimes portability is just about spanning different versions of Windows but more often than not, it's about covering the growing "alternative" desktop market. Users want applications that provide entertainment or communication or educational experiences that are worthy of the fine computer hardware they're seated in front of, and the zippy internet service they're connected to. Developers are choosing Swing to deliver those experiences and here, at camp Swing headquarters, we couldn't be happier.

It's good to be king and it's hard to be humble. I feel a T-shirt coming.

duke1.gif

Thanks to Jeff Dinkins for another bit of just-in-time artwork!



Open Source Bluegrass

Posted by hansmuller on October 05, 2005 at 01:23 PM | Permalink | Comments (6)

This past Saturday morning, a friend and I were in San Francisco at Golden Gate park, walking out of the Speedway Meadow. It was cool and overcast and the fog blanketed the tree tops and hung over our heads and gave the surroundings the blurry hazy look of an old newsreel. We were walking down into another hollow, listed on the map as Marx meadow, and drifting toward us was the sound of Joan Baez singing "The Night They Drove Old Dixie Down". The long narrow meadow is flanked by steep hills and tall trees. With its foggy ceiling and dim light it felt like a cathedral. There were thousands of people there, listening, shuffling toward the stage for a better view or just sitting in the grass listening to the story about Virgil Caine and the tragedy of the American Civil War. We joined them and listened to Joan Baez sing more old American songs, songs by Woody Guthrie and Bob Dylan and folk songs that have been around so long they're just attributed to "traditional". I'll never forget being the same place last year listening to John Prine sing "Angel from Montgomery" or this year, hearing anti-war and protest songs inspired by conflicts from the distant past and from right now.

It's tough to write about how great it was spending a day listening to music. It was entertaining, it was moving, it was fun, sometimes it was beautiful. In the evening it was really cold. You should have been there. If you live in the area, you should have stepped away from the keyboard and taken your head out of the network for a while, and plugged it into the music. At least that's what I did and I couldn't have been happier. But that's not why I'm writing this.

There were five big stages in Golden Park on Saturday and Sunday, different bluegrass and folk music performers every hour, from 11AM till 7PM, and it was all free. Free as in Free Beer. A (very) wealthy man named Warren Hellman has been putting on the "Not Strictly Bluegrass Festival" show on his own dime for the past five years. I can't tell you exactly why he does this, although if I had to guess I'd say he's motivated by the same spirit that inspires software engineers to join open source projects and build things just for the pure joy of it. That spirit confounds economists looking for a profit motive and capitalists looking for a profit. There were about a bajillion people in Golden Gate Park taking in the music over the weekend, and they weren't confused at all.

So I just wanted to say thank you. Thank you Warren Hellman for sharing two days of music with the Bay Area, again.

If you've actually read this far and have made a mental note to delete me and my moon-eyed ravings from your RSS feed, here's a non-sequitur that I hope you'll find reassuring. It doesn't have anything to do with free music, but it's a genuine Java code sample that you might find useful.

Examples from the java.util canon are usually short and tidy. In theory, now that we have type parameters, the can be even shorter and tidier. For example if you have a TreeMap that defines the number of occurrences of each word in a document, you can print them all like this:

Map<String, Integer> countMap = new TreeMap<String, Integer>();
...
for (Map.Entry<String, Integer> e: countMap.entries()) {
    System.out.println(e.getKey() + ":" + e.getValue());
}

All well and good, unless you wanted to see the word/count entries sorted by word count, not by word. TreeMap keeps the entries sorted by key, that's the word String in this case. To sort the word/count Map.Entry entries by word count you must convert the entries to a List, define a Comparator that compares Map.Entry values, and then use Collections.sort to sort the list.

/* Sort the entries in countMap by count.  This code has
 * me wondering about just going back to AWK.
 */
Comparator<Map.Entry<String, Integer>> compareEntries =
    new Comparator<Map.Entry<String, Integer>>() {
    public int compare(Map.Entry<String, Integer>e1, Map.Entry<String, Integer>e2) {
        return e2.getValue().compareTo(e1.getValue());
    }
};
ArrayList<Map.Entry<String, Integer>> entries =
    new ArrayList<Map.Entry<String, Integer>>(countMap.entrySet());
Collections.sort(entries, compareEntries);

Maybe it's just me, but yech. Sometimes I'd really rather just listen to Earl Scruggs play Foggy Mountain Breakdown.





Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds