Here are some Swing links that you might have missed during the last week:

  • Ken Kousen has posted the third part in his explorations of mixing Swing and Groovy, addressing the EDT aspects of his earlier post. Swing EDT rule is very simple – anything UI related must be done on the EDT thread unless explicitly stated in the API specification. Ken’s narrowing of the rule to apply to updates only is unfortunate and is the same as using synchronization on setters but not on getters. It might bite you less, but it will bite you nonetheless.
  • Matt Nathan reports on cleaning his SwingX incubator space. His incubator contains components (clock, stopwatch, inspection panel), a number of effects, rollover support and scalable icons (similar in concept to Flamingo‘s resizable icons).
  • Greg Brown has announced release 1.0 of the Pivot framework that aims to allow building high-quality, cross-platform applications that are deployable both via the web and to the desktop.
  • Robert Bajzat has published beta 0.7 release of Thinlet Swing components. It has a number of widgets and utilities, such as balloon tooltips, balloon dialogs, form fields with validations and rich editors (including calendar and tree), simple charts and more.
  • Geertjan Wielenga interviews the new lead of Spring RCP project. Lieven Doclo has taken over the development which has been stopped and started too many times before him, and time will tell how much energy will be left after the first few weeks.
  • Unlike in the years before where JavaPolis Javoxx Devoxx has positioned itself as a conference with hand-picked selection of by-invite-only speakers, this year the organizers have decided to issue a call for participation. Three active and well-maintained Java projects will be there. David Gilbert will present a session on JFreeChart, Maxim Zakharenkov will present a session on SwingExplorer, and Alex Potochkin will present a session on JXLayer.

I have already written about the Ribbon control reaching beyond Office into the core applications that are scheduled to be shipped in the next Windows version. This is gaining even more traction with the inclusion of Ribbon in the official MSDN Windows Vista User Experience (UX) Guidelines. It had been also known as Command Bar and Fluent Interface in the different UI Design Guidelines, but it appears that the name “ribbon” is back.

The current preliminary documentation does not only provide the answers to “how”. One of the more important aspects is answering the “when” and “what not to do”. The introductory section delves into the different questions that must be considered before using ribbon in your application. And while the subsequent sections are mainly focusing on the different UI elements of ribbon, they also provide the “correct” and “incorrect” usages of these elements. Here are three examples of incorrect usages from the document:

This is a mockup design of “ribbonized” calculator that clearly has nothing to gain from putting the controls into a ribbon. Following the usual physical layout of the calculator buttons allows users to quickly discover the functionality; there is enough space to arrange all controls so that they can be accessed with a single click; the number of commands is relatively low (in tens); finally, there is no “content area” for the calculator – the result is just a wide single line text box.

Here, the application menu button is added to a window with a menubar. The UX Guidelines are strictly against combining the application menu button with a menubar or a toolbar. In this case, the application menu button aims to replace the “File” menu, but all the other menus are still there.

Here, all the buttons in the ribbon are menu buttons displayed at full size. According to the current guidelines, you might as well use the menu bar and save the vertical space.

The “Program Command Patterns” document delves even deeper into making the decision on presenting the UI commands, discussing when it is appropriate to forgo the ribbon interface and use the more traditional elements such as menu bars, toolbars and direct command controls.

Here are some Swing links that you might have missed during the last week:

  • James Britt has an article on IBM.com developerWorks site on developing JRuby Swing applications with Monkeybars library.
  • Jean Francois Poilpret continues tackling the more intricate problems with layout managers. This week he analyzes the real-time resizing of different components, including sliders, tables and scroll panes.
  • Mikael Grev promises imminent availability of WebStart version of his media player. Currently hehas no plans to open-source the implementation, but the reasoning (no need for outside help) seems a little peculiar. I have repeatedly found over the past years that even if i am the sole developer on the project, it is the user feedback that is driving the project forward.
  • David Benson has announced the initial beta release of JGraph X Swing diagramming library.
  • Following the announcements on the Griffon project, Andres Almiray has updated the JideBuilder and GraphicsBuilder projects. JideBuilder 2.0 and GraphicsBuilder 0.6.1 are now under Griffon umbrella.
  • Ken Orr writes about image-based method to create non-rectangular active (clickable) areas for Swing buttons. While this technique has its merits (splitting the work between the designers and developers is one such example), the needs of modern UIs render it somewhat obsolete. Such aspects as support for High DPI mode, skinning and animations require more advanced solutions.
  • And finally, while not strictly Swing related, this might be of an interest to the readers. PulpCore is a new 2D rendering and animation framework for the Java applets available at Google Code repository under BSD license. Milpa is an example of PulpCore-based applet game, and it has all the characteristics of a browser-oriented game. It loads fast, has a lot of animations and is very responsive.

Following the extremely valuable feedback on the previous entry that introduced the application menu button and application taskbar to the Flamingo ribbon component, i have been busy this week fixing the usability issues and addressing some of the missing popup functionality available in the Office 2007 Command Bar component.

Christopher Deckers has pointed out a few usability issues that eluded me as i was focusing too much on the pixels. He was correct to point out that everything related to popups (such as the main application menu button and ribbon gallery expansion) and the task toggle buttons should happen on mouse press and not on mouse release. This has been addressed in the latest 4.0dev drop of Flamingo (code-named Fainnear) and is also available as a configuration API on the org.jvnet.flamingo.common.model.ActionButtonModel.

A number of comments pointed out that the application menu is showing on top of the application menu button, thus losing the visual connection between the two components. The solution had to work on both lightweight and heavyweight popups, and the latest 4.0dev drop provides such a solution.

Here is the application menu under Metal:

And under Windows look-and-feel when the mouse is moved over the primary Open entry:

And under Synthetica Blue Ice look-and-feel showing a split Save As menu entry in action:

And under Nimbus showing the split Print primary menu entry with two groups in the secondary menu:

And finally, under Substance Business Blue Steel skin showing the popup-only Send primary menu entry with one group in secondary menu. One of the secondary menu entries is a popup button itself and has the associated PopupMenuListener. This listener populates two items in the third-level popup menu – click to see full-size:

The latest 4.0dev drop also allows placing mixed content into the popup panels. Most of Office 2007 split / popup buttons show a button panel wrapped in a scroll panel, followed by a mix of menu items and separators:

This is now available for Flamingo ribbon galleries and split / popup command buttons. Here is an unexpanded ribbon gallery under Synthetica Blue Moon look-and-feel:

When the expand button is clicked, the following popup is shown:

The top portion of this popup has the scrollable panel that hosts all the gallery buttons, and the bottom portion hosts the additional menu buttons and separators. The top panel can be scrolled:

And the menu buttons show rollover effects:

The same rich popup functionality is available on command buttons with popup area (split or pure popup). The following screenshot shows a rich popup on “Format” button in the first ribbon band (under JGoodies PlasticXP look-and-feel):

And the same under Substance Office Silver 2007 look-and-feel:

If you want to see the reworked application menu button and enhanced popups in action, run the following WebStart demo:

The demo above works for the core look-and-feels. If you want to see this functionality under Substance, run the following WebStart demo:

If you want to test the new functionality in your applications, you would need the following (the last two only for applications running under Substance look-and-feel):

The relevant APIs are in the org.jvnet.flamingo.common.popup and org.jvnet.flamingo.ribbon packages. Until the documentation is ready, see the test.ribbon.BasicCheckRibbon class. This is still work in progress so the APIs may change during the development cycle. Your feedback is, as always, greatly appreciated.