BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Pivot: Re-Inventing the Java Applet?

Pivot: Re-Inventing the Java Applet?

This item in japanese

This past week, Greg Brown announced a new open-source GUI toolkit for Java, Pivot:
I would like to introduce the Java development community to the Pivot platform. Pivot is an open-source framework for building high-quality, cross-platform applications that are easily deployable both via the web and to the desktop. It began as an R&D effort at VMware and is now being made available to the community as an option for developers who want to build rich client applications in Java.
Pivot borrows several ideas from toolkits such as Swing, while also taking advantage of the improvements made in the Java2D pipeline over the last several years. Applications built with Pivot will be developed using a combination of Java and XML.

Pivot, as a platform, is meant to directly compete with Flex and Silverlight as a rich-client that is embeddable directly in the browser. The Pivot developers consider part of that platform to be Java 6 update 10, also known as the consumer JRE.

In March of 2007, Greg Brown posted 'Reinventing the Applet' on his blog, where he discussed several of the shortcomings of the then-current-iteration of applet technology, and what he felt would need to be fixed to make applets more competitive. The recent announcement of Pivot was posted as a follow-up to that original article. He now describes the consumer JRE as a key element to the success of Pivot. There are a number of technologies in the JRE update that play an important role in the viability of any embedded application developed using applet technology:
  • Java kernel - The Java kernel reduces the download size of the base JRE significantly.
  • Next-Generation Java Plug-in - The new Java plugin runs as a separate process from the browser, preventing browser lock-ups, crashes, and other slowdowns. It also provides better user feedback during startup and other state transitions.
  • Java Deployment Toolkit - The deployment toolkit provides all of the necessary APIs and browser integration to provide a seamless installation/upgrade process, making it simple to determine Java version, and help users upgrade as necessary.
  • Java QuickStarter - The quickstarter takes advantage of OS disk cache (among other things) to improve Java VM startup times.
  • Direct3D Integration - For Windows users, the changes to the Direct3D pipeline should improve rendering performance for anything using Java2D. For other platforms, a similar overhaul of Java2D for OpenGL was performed previously.
Java 6 update 10 is currently in beta, and is intended for public release later this year.

The announcement of Pivot triggered a number of positive and inquisitive comments - Ben Galbraith offered a lot of input as well as a number of questions:
Looking over your classes now. Interesting how your architecture is from a high-level is very similar to Swing. The contract for components, UI delegates, listeners, etc. is all quite similar (e.g., the way layout works is in particular very similar). Were you shooting for "Swing evolved?"

I can see you've hit a few of my favorite Swing pain points:

  • preferred width and height available as separate or atomic properties
  • wrapping labels (do you support any label text formatting? doesn't look that way)
  • row-based table data model
  • built-in "form" constructs
Some addt'l questions:
  • Why in heaven did you create your own collections classes? Why, man, why?
  • Do you have any analog for Swing's UIDefaults?
  • Why did you leave state out of your Action interface? Do you have any analog to Swing's Action interface in terms of sharing action state?
  • I didn't see any layout managers; how do you handle layout? The tutorial mentioned that skins do it, but I didn't see any contract stand out (other than the built-in methods on Container).
There is a demo Pivot applet available to try, as well as a work-in-progress Tutorial. There is more information about Pivot available both at the Pivot homepage as well as on Greg Brown's blog.



Rate this Article

Adoption
Style

BT