Skip to main content


Posted by editor on October 23, 2007 at 7:19 AM PDT

The sliding, fading, floating GUI... made easy

I went to an Apple developer event last year, and came away very impressed by the design of the Core Animation framework in the upcoming Mac OS X 10.5 (Leopard) OS. It uses a property-binding scheme to allow you to animate parts of your GUI as things change. I'm a fan of animation when used properly -- "to show change in context or content" is my rule -- and found myself wondering about the practicality of doing the same thing in Java. Of course, the whole issue of properties is in play at the moment, but it's at least not impossible that you can say "treat the component as a JavaBean, and animate the y value between these two extremes over this period of time." But it's still got hassle written all over it.

So, Plan B. What if you could just say "here's my Container now, and here's what it's going to look like as a result of the action I'm handling, just animate all those changes for me." And if that were handled not by actually moving the components on different layers, but rather by just grabbing images of the before and after and painting the tweens on the glass pane... well, I wouldn't mind that one bit.

And that, in a nutshell, is the idea of the Animated Transitions project. You provide the initial Container and change it in a callback method, and of course you make sure to actually use the same components (i.e., literally the same objects) in each state, so the library can figure out if a given component has appeared, disappeared, or moved. This gives the library all the information it needs, and allows it to fade, slide, spin, or otherwise animate the changes in your GUI.

The topic is the subject of Chapter 18 of Filthy Rich Clients, and
in today's Feature Article, co-author Chet Haase gives a brief introduction in
Create Moving Experiences with Animated Transitions. He offers a short demo of the library, along with screenshots and, most helpfully, videos ( "">QuickTime
or "">
) showing the transition effect. Even if GUIs aren't your thing, take a look and ask yourself if you wouldn't rather have this kind of user-experience instead of "snapping" changes in your face and expecting you to parse the delta. As Chet explains:

That's what Animated Transitions are all about: animating the user interface from one screen of the application to the next, to create a seamless flow between these states. Transitions help keep the user connected to the program by helping them understand how the UIs fit together.

So have a look, and the next time you see some nice behavior elsewhere, like iChat users fading as they log out or moving to an "idle" section of your buddy list, consider that this kind of thing is highly doable in Swing too.

In Java Today,
NetBeans IDE 6.0 Beta 2 is now available for download. The focus of NetBeans 6.0 is superior developer productivity with a smarter, faster editor, and the integration of all NetBeans products into one IDE. NetBeans IDE 6.0 features Ruby/JRuby/Ruby on Rails support, enhancements for improved Swing development, a new Visual Game Designer, updated Data Binding support, integrated Profiling, and more. Plus the new installer lets you customize your download preferences--choose the features and runtimes you need in one go.

The Java SE Deployment team's Ken Russell has been talking about his group's work on a new Java Plug-In on several websites. He tells JavaLobby that the new plug-in will improve reliability by running in a separate operating system process from the web browser, which will allow for more powerful applets, permit the termination of poorly-behaved applets, and eliminate browser crashes caused by applets. Then, in a video interview with, he talks with Ben Galbraith about more plug-in tidbits, "such as having JNLP working natively in the browser, and how this could be used to allow other scripting engines such as JRuby to run in the browser. One JNLP extension, and everyone can share JRuby."

The ON project "is a small, free library, enabling powerful object notation .It provides a surprisingly easy to use, yet completely understandable way to notate object in human nature reading and thinking way. It is actively being deployed in most language environment such as Java, C, C++, and so on, all over the world. Its core is just a grammar in ANTLR syntax."

In today's Forums,
E-ming Saung announces the latest ME SDK release from Sun in
Sun Java Wireless Toolkit 2.5.2 released!
We've released the WTK 2.5.2 (Windows, Ubuntu Linux, and multilingual versions) with improved multiuser environment support. We've heard and listened to users' comments and have recompiled our WTK for Ubuntu linux based on Glibc 2.3 libraries to provide support for other distributions of Linux. Keep in mind, the WTK has been tested on Ubuntu Linux version 6.x. Download the latest version today.

stylertim isn't comfortable with what Windows claims is his app's memory use, in
Windows Task Manager displays faulty memory consumption?
"I'm currently developing a Java3D application involving landscape creation. This is obviously very memory consuming depending on the size of the objects used. Still, the Windows Task Manager (WTM) seems to fail to compute the correct memory consumption. When I start my application all that is drawn are some Swing components - about 26MB of RAM is used according to WTM. After minimizing and maximizing the JFrame the consumption shrinks to 12MB which is 50% of the original value. The same thing happens after adding the JPanel that contains the Canvas3D used to render 3D data."

tmilard needs compressed audio in JOAL, according to the post
JoalMixer reading .mp3 file...
"I use joalMixer which is good. It reads wav files. Because of limitation in bandwith over the Internet, I really need to load mp3 files rather then wav files in the JOAL API. Question 1: Has someone in java3D+JOAL+JOALMIXER community has coded it? Question 2: If not, is someone interested also with one 'improved' JoalMixer that reads .mp3? I am willing to do it with someone Question 3 : Please if you want also this joalMixer addon (read mp3 files)) let me know."

David Herron considers the Rich Internet Application alternatives in today's Weblogs.
Web 3.0 ??, he writes,
"I've been doing some research on the coming wave of technology for "Rich Internet Applications" (my links tell the story).. This JavaFX thing is very interesting and intriguing, as well as the other developments we're working on."

Jan Haderka announces a new SwingX release in
Quo Vadis SwingX.
"To cut long story short: We have improved and extended SwingX a lot since last release and we have paid attention to the voices in community that called for newer release Now, I'm pleased to say that new milestone build of SwingX - Milestone 0.9 is now available at SwingLabs website for download."

Finally, Van Riper puts out the call:
Silicon Valley Java Developers Unite!
"I have already blogged earlier about Silicon Valley Code Camp. This is my final call to action for the Java developers in Silicon Valley. All the Java sessions at Code Camp will be held on Saturday, October 27th. Come for the entire day or just come for our main community event at 3:45pm when the Java Posse will be doing a live podcast episode recording."

Current and upcoming Java

Registered users can submit event listings for the href=""> Events Page using our href="">events submission form.
All submissions go through an editorial review before being posted to the

Archives and Subscriptions: This blog is delivered weekdays as
the Java
Today RSS feed
. Also, once this page is no longer featured as the
front page of it will be
archived along with other past issues in the href=""> Archive.

The sliding, fading, floating GUI... made easy