The Source for Java Technology Collaboration
User: Password:



Scott Violet

Scott Violet's Blog

Extreme GUI Makeover: 2006

Posted by zixle on November 21, 2006 at 07:42 AM | Comments (25)

During one of many brainstorming sessions for the 2005 JavaOne conference the Swing team latched on to the idea of doing a makeover talk. Borrowing the idea from the popular TV show, the idea was to makeover an ugly ducking of a Swing app, turning it into a beautiful swan. Shannon, Romain and myself had a great time putting the app together and doing the session; as a bonus, the session was one of the most popular talks. WOW! Because we had so much fun, and because of the popularity, we decided to do a similar session for 2006.

For the 2006 session we decided to make over a mail client. A good chunk of my day goes into reading email, so I had a plethora of ideas in this area. This was true of Romain and Shannon as well. We didn't have the time to craft a real mail client, or the time to come up to speed on one of the many open source mail clients out there. As such, we put together a shell of a mail app. It has just the amount of functionality we needed for the demo, that's it. We tuned for demos, with just the windows look and feel. Romain says it works on OS X, which is surprising. There is plenty of stuff that doesn't work, and you can get stuck in areas where you can't get out. It's most defintely a DEMO! Let me say that one more time, THIS IS A DEMO! None-the-less we've gotten a slew of email requests for the code, some friendly, some not so friendly. So, in all it's glory, here's the code.

Here's a screen shot of the before:

And the after, with a traditional table:

A screen shot with a rich list:

The screen shots don't do the transformation justice; they can't show transitions, animation, custom drag and drop effects... For that, you need to run the app. You can run the app by downloanding this zip file, extracting it, and invoking java -jar mailman.jar on the jar file.

All 103 slides from the session can be found here.

A big part of the presentation was showing the ugly, then transitioning to the improved. To provide a similar experience for those trying the app now, I scripted the whole app with Robot. If you don't move the mouse, the demo will drive itself. It'll take you through each of the stages showing the before and after. I'll go over how this was done in more detail later. For those that want to know now, look in the appscripter package.

Wouldn't it be cool if I did voice overs? Or music? Or provided links to the code while running it? Or fixed some bugs in the message handling? Or added comments? Yes, yes and YES! The list of things I would like to do to this app could keep me employed for years. But, I know folks want the source, so we're cutting the cord. Have at it! I do promise Shannon, Romain and myself will go over aspects of the session in more detail over time.

Enjoy!

     -Scott

PS For those thinking a webstart link would be ideal. I agree. For JavaOne I threw a 5MB mailbox at the original parsing code, and it took minutes. I rewrote it using NIO, which means it won't work from WebStart. Hans pointed this out months ago. Not having time myself, I dropped the gauntlet and challenged Hans to give me the code that would suck down the mailboxes so that it would work from WebStart. Months later that code isn't in my mail box. Perhaps the public humiliation will be enough to get Hans to give me the code and I'll update the app later on;)


Bookmark blog post: del.icio.us del.icio.us Digg Digg DZone DZone Furl Furl Reddit Reddit
Comments
Comments are listed in date ascending order (oldest first) | Post Comment

  • Downloading now...excellent! so happy :)

    Posted by: stlum9495 on November 21, 2006 at 08:23 AM

  • is there a secret to starting this up beyond java -jar mailman.jar ? I used that command and I got an email program that surprisingly looked like the non-pretty version.

    leouser

    Posted by: leouser on November 21, 2006 at 11:18 AM

  • If you don't move the mouse (or click the skip demo button) it should take you through it all.

    If that doesn't work for you, try right clicking on various areas and choose the options that appear.

        -Scott

    Posted by: zixle on November 21, 2006 at 12:46 PM

  • It is necessary use the J2EE6.0 to compile the program? or can I compile with the 5.0?
    Thanks in advance

    Posted by: itelleria on November 21, 2006 at 01:03 PM

  • hmm, after not moving the mouse around like a nut it does proceed. But it bombs as the demo is going along with this useful stack:

    Problem executing script, stopping: java.lang.RuntimeException: Error executing
    java.lang.RuntimeException: Error executing
    at appscripter.DemoExecutor.executeInBackground(DemoExecutor.java:238)
    at appscripter.DemoExecutor.executeInBackground(DemoExecutor.java:175)
    at appscripter.DemoExecutor$Runner.run(DemoExecutor.java:647)
    at java.lang.Thread.run(Thread.java:619)
    Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at appscripter.DemoExecutor.executeInBackground(DemoExecutor.java:233)
    ... 3 more

    leouser

    Posted by: leouser on November 21, 2006 at 01:17 PM

  • It is necessary use the J2EE6.0 to compile the program?

    You'll need Java SE 6 (aka 1.6).

        -Scott

    Posted by: zixle on November 21, 2006 at 02:20 PM

  • leouser,

    What OS are you running on? At what point in the demo does it bomb?

       -Scott

    Posted by: zixle on November 21, 2006 at 02:20 PM

  • Solaris 10. The explosion occurs after the "Add Depth With Drop Shadows" each and every time.

    leosuer

    Posted by: leouser on November 21, 2006 at 02:29 PM

  • Er, we never tested it on Solaris and since the demo relies on the Windows look and feel (well, more or less) that's might be why :)

    Posted by: gfx on November 21, 2006 at 02:53 PM

  • uh oh... oh well, I can live with other's tales of glory.

    leouser

    Posted by: leouser on November 21, 2006 at 03:08 PM

  • Hi Scott,
    Your weblogs are really informative informative.I am really interesting in the accompanying BINDING.JAR. Here is
    my questions:
    1) Is it an early reference implementation of "JSR 295: Beans Binding"?
    2) Is there any means that i can get the source code ? or
    just binary with documents? it did not appear on dev.java.net.
    3) what's the releasing plan of binding.jar ?
    thanks in advance.

    Posted by: jwfang on November 21, 2006 at 06:13 PM

  • Hi scott,
    Is it possible to get the sources for the XTreme GUI Makeover session of 2005 too

    Posted by: psychostud on November 21, 2006 at 08:39 PM

  • +1 for source for Extreme GUI Makeover 2005 :) Gosh, it's almost like making the pre-emptive Xmas list to Santa...

    FYI -- don't mean to state the obvious, but for for non netbeans users, class BlurryTest has a dependency on org.jdesktop.layout.GroupLayout. I removed the import and tried to use the GroupLayout in JDK 6 and they are not the same. So I just added swing-layout jar to my classpath https://swing-layout.dev.java.net

    Demo is top notch...thx again

    Posted by: stlum9495 on November 22, 2006 at 12:30 AM

  • My question would be do I need Netbeans to build it? Just using ant from the command line gives me a bunch of classdefs not found.

    Posted by: osbald on November 22, 2006 at 02:31 AM

  • Make sure you have Java SE 6.

    Posted by: gfx on November 22, 2006 at 04:15 AM

  • I have Romain although 5.0 is my default. I set JAVA_HOME to 6.0 and reset PATH=%JAVA_HOME%\bin;%ANY_HOME%\bin ..because its Windows. java -version and javac both report 1.6.0-rc but I get missing class defs on a bunch of classes from the org.jdesktop.layout package.. which jar will they be in? dosnt seem to be supplied.. oh wait there is a binary version too ..ah the src distribution is missing the swing-layout-1.0.jar.

    Posted by: osbald on November 22, 2006 at 04:40 AM

  • Hello Scott,
    thanks for sources and prezentation, I really enjoy yours two hours on GUI in Prague even that I part of your extreme GUI prezentation read before.
    Can you please also share sources for Extreme IM messeger? First, in my opinion this is better one :o), and second, I´d like to wrap some of IMmessaging library and put it to real use.

    Posted by: hissun on November 22, 2006 at 06:41 AM

  • jwfang,

    Thanks for the kind comments!

    I am really interesting in the accompanying BINDING.JAR. Here is my questions: 1) Is it an early reference implementation of "JSR 295: Beans Binding"?

    binding.jar was a proof of concept for 295.

    2) Is there any means that i can get the source code ? or just binary with documents? it did not appear on dev.java.net. 3) what's the releasing plan of binding.jar ?

    I have to do a number of changes to binding before I release it. I'm trying my best to have those done by the new year and make the project public.

        -Scott

    Posted by: zixle on November 22, 2006 at 07:18 AM

  • psychostud,

    Is it possible to get the sources for the XTreme GUI Makeover session of 2005 too

    Legal wore me down in getting this code released, but I'll start that process next.

        -Scott

    Posted by: zixle on November 22, 2006 at 07:19 AM

  • Can i grab the video of this session ?

    Posted by: index_0 on November 22, 2006 at 07:21 AM

  • My question would be do I need Netbeans to build it? Just using ant from the command line gives me a bunch of classdefs not found.

    D'OH! As some one mentioned, I forgot to include swing-layout. Sorry about that. If you use NetBeans this isn't a problem;) None-the-less I've uploaded a new version that includes swing-layout and should be buildable outside of NetBeans. Let me know if you still have a problems.

        -Scott

    Posted by: zixle on November 22, 2006 at 07:42 AM

  • Though I like some of your changes and agree that it makes the app look better. The tree view is ugly with those blue buttons.

    Posted by: dog on November 22, 2006 at 01:28 PM

  • dog: Actually the point of the Extreme GUI Makeover demos is not really to make the application look better (although some of the stuff we implemented are meant for that) but more to show you how far you can go with Swing and what kind of effects you might want and can add to your own applications. If you don't like the tree buttons, it's cool but they show how you can make items react to drag and drop and how you can add drop shadows to non-rectangle components very easily.

    Posted by: gfx on November 22, 2006 at 02:46 PM

  • "Er, we never tested it on Solaris and since the demo relies on the Windows look and feel (well, more or less) that's might be why :)
    -Scott"


    Hmm, wasn't Java, and especially Swing, all about "write once, run anywhere" ?

    I haven't looked at the code yet, but In what ways does this demo depend on the Windows LaF and how hard would it be to get effects like this in other LaFs like Ocean on platforms with less tuned graphics drivers? Running this on a recent X.org 7.1 locked up the window manager with the same stacktrace as already posted by the way.

    Posted by: mathiasdebelder on November 23, 2006 at 11:11 AM

  • "Hmm, wasn't Java, and especially Swing, all about "write once, run anywhere" ?"

    That kind of sentence really does not make me want to explain. Scott said it clearly enough: this is demo and we took shortcuts to be ready in time for JavaOne :) The code does not really require the Windows look and feel, we just extended a couple of UI delegates to get to our goals faster. That's all. No need to throw the WORA stuff at our face.

    Posted by: gfx on November 23, 2006 at 12:51 PM



Only logged in users may post comments. Login Here.


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