The announcement of JDICPlus project that was made last week was a little unexpected. This was mentioned in the latest installment of Swing links of the week, and subsequently picked by DZone and java.net editors. The comments on both the original announcement and on the DZone thread are mixed, and most commentors point out that JDIC and JDICPlus could provide a little bit more information on their status and roadmaps.

Alexey Utkin is the man behind the JDICPlus project, and he graciously agreed to answer a few questions that i had in mind.

Tell us a little about yourself.

Alexey Utkin avatarI was born in 1971 in Saint-Petersburg, Russia and still living here. I started writing programs at school and never stopped doing it. I got my PhD diploma in physics and mathematics in St.-Petersburg State University where I am lecturing now at Calculating Physics Department. The longest period of my developer’s life was spent working in Novavox company. For a year before joining Sun Microsystems, I worked for Borland till closing of the local office. Since 2006 I work as a developer in AWT group. I like fine solutions of complicated problems, read with interest avva’s live journal and Facebook puzzles.

Can you overview the history of JDIC project?

Really I can not. The only history that is accessible for me is the diffs in CVS. Some ideas were brilliant, and others were not. My last 15 years were spent for DOS/MS Windows development in C++. In Windows OS family the browser embedding was never a problem, so I did not need JDIC before.

The JDIC project has not seen any substantial activity after a lot of its functionality was incorporated into Java SE 6. Do you know the reasons?

The answer is in your question. Most of the JDIC functionality was transferred to Java SE 6. The browser part was not. An approach with inter process communication over a socket connection is not suitable for real life. But any released solution in Java becomes a standard, especially in case of browser component. My opinion is that JDIC browser
reached the top of functionality in the confines of the chosen architecture, but it was not enough for main stream release.

What is JDICPlus? Is it your personal hobby, simple exploration of new ideas or the renewed investment from Sun in JDIC for Java SE 7?

It’s clear that Java needs standard embedded browser. We are working on it. Of course, JDICPlus is not a candidate for Java SE 7. JDICPlus is a part of my research work about an ability to use native browser as some kind of an external AWT/Swing component. Currently it is a personal hobby. I tried to create primitive communication with browser and take mostly the native renderer. DOM and events treatment subsystems are already inside and it works perfect with Javascript. If you get the connection point from Java level to Javascript with callback ability – you have everything that you can for free.

Is there a roadmap for JDICPlus? What are the projected areas that it is going to concentrate on, and what are the target platforms?

At present the JDICPlus project doesn’t have an “official” status. It is an incubator in the full meaning of the word. Currently there is no roadmap for JDICPlus at all. I will spend the time implementing the most essential OS functionality that is not accessible from Java. JDICPlus CAB format coder/encoder with ZipInputStream/ZipOutputStream interface is such an example. For browser it is possible to capture new window creation event – that is done in TabbedBrowser (WebStart link). There are the problems with child windows rendering and common stability. I hope to solve it soon.

Are there any plans to port the support for translucent and shaped windows to JDIC or JDICPlus, so these can be used on JDK 5.0?

JDICPlus supports very strict approach to shaping and translucency that makes IE browser similar to real lightweight component. Potentially it could be propagated to JDK 5.0, but all project orients to JDK 6.0. The problem is complicated, especially taking the cross-platform aspect into account. Please wait for the main stream release solution.

Are there any plans to investigate support for cross-platform browser toolkits, such as Webkit or Gecko?

Gecko is progressing too fast. Attempting to embed Gecko is a constant challenge. The key part of API is incompatible with older versions, and you can not distribute Gecko together with your product. That is a dead circle and JDIC is a good example. May be something will change in future. Webkit is impressive, but young. Let’s wait and see.

Are there any plans to handle the issues reported on JDIC over the past eighteen months?

The most critical bugs reported on main stream release (based on 0.9.2) will be fixed. But the main project is frozen for new features.

What are your thoughts on pure-Java solutions as opposed to embedding native components / toolkits?

Let’s try to be realistic. I don’t think that Sun has any reason to join the browser war. The existing pure-Java solution in Swing is acceptable for rendering simple HTML snippets. But now nobody is interested in a partial solution. The compromise is available and more or less predictable. Wait…

What would be your top three wishes for Java desktop?

  1. Standard cross-platform solution for embed browser (surprise?! )
  2. Shaping and translucency (smile)
  3. Perfect MS COM/DCOM interconnection with Java classes. It can really make Java the number one development environment under the MS Windows.

With this, i hope that at least some of your questions have been answered. I’d like to thank Alexey for agreeing to answer my questions.

Last week i talked about using Substance decoration painters to visually offset Flamingo ribbon component. Jonathan Giles asked a question in the comment sections on how hard would it be to apply these improvements to an application running under other (core or third-party look-and-feels). I did not wish to rush into implementing it, and let it simmer for a while. A few possible solutions presented themselves, some involving colorization on the UI delegate level, and some involving off-screen images and overriding one of the paint methods in the main component.

As expected, the simplest solution is also the most powerful, since it can be applied to any Swing component / container, involves a few lines of code and doesn’t require any changes in the component library. It uses the JXLayer wrapper developed by Alexander Potochkin and one of the filters from JHLabs project.

The JXLayer is a very powerful component that deserves much more attention that it has been getting over the past couple of years. It allows intercepting events, masking out some parts of the UI area, providing validation feedback, adding custom painting and much more. In our case, all we need to do is:

  • Wrap the ribbon in a JXLayer
  • Add a painter to that layer
  • Create an image effect and add a rescale operation on it that shifts the colors towards light blue
  • Add the effect to the painter

At this point, all the visuals from the ribbon will be shifted towards light blue color:

All this amounts to extra 8 lines of code, as shown in the new sample application shipping with the latest 3.1dev drop of Flamingo. While this requires extra two jars in your classpath, the solution is not only elegant, but also applicable to any Swing component / container.

The release candidate for version 4.3 of Substance look-and-feel (code-named Nairobi) is available. The list of new features includes:

Target date for release is April 14. Only defects will be fixed until this date.

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

  • Is there new life for JDIC? It started with a big bang in 2004, pretty much died late 2006 when Mustang was released and now looks like it has received a renewed attention. The announcement on the forum introduces JDICplus project. At this stage it is a Win32-only wrapper around the Internet Explorer. The main page has four WebStartable applications that show IE, map explorer, flash viewer and HTML editor. The functionality looks very similar to the DJ Native Swing project, except the multi-platform support.
  • Are you interested to know when Apple is going to release JDK 6.0? You can know the answer to this question, with one small caveat – you can’t tell anyone. Oh, and you have to pass the interviews and sign a few papers… If you are interested to work for Apple’s Java team on AWT, SWT, Swing and other areas, follow this link to read the job description and apply.
  • Build 14 of 6u10 closes the bug on bringing SwingSet2 to be a better demo application for Swing. Looks like SwingSet2 will be no longer maintained, and instead will be replaced by two new java.net-hosted projects. The first is SwingSet3 that will show the core Swing features, and the second is Laffy that will act as look-and-feel test bed. Unfortunately, SwingSet3 is still a private project and can not be accessed (unless you have special privileges), and Laffy’s main page is still the template one.
  • Robert O’Connor explores the different closures proposals and how they apply to primitive Swing applications. The first entry is on FCM, and the second entry is on BGGA. If you have a UI with one button and one-line action listener, you might even cut down the number of lines in your application :)
  • Daniel Leuck proposes a format for packaging multi-resolution icons in Swing applications. This is one of the issues facing UI application running on high-resolution monitors. If you are interested in this subject, please consider coming to a birds-of-feather session that i will be presenting with Mike Swingler (of Apple’s Swing team) at this year’s JavaOne.
  • Collin Fagan introduces a few JavaFX-inspired panels that aim to make it easier to work with core Swing layout managers. Why would anyone still want to use the GridBagLayout is a mystery to me.
  • Thierry Lefort experiments with multiple popup toolbars that provide functionality similar to that of Office 2007 MiniBar (floatie). This topic has been mentioned in the session that Jensen Harris (lead designer of Office 2007) has presented at this year’s MIX conference (click here for the PowerPoint presentation or visit the site to view the video feed of the session). They eventually decided to have only one floating toolbar that fades out as you move the mouse away from it.
  • Christophe Le Besnerais writes about a class that allows showing any Swing component in its own non-taskbar window. It doesn’t really go beyond providing a simple wrapper around the Popup and PopupFactory classes, and the translucency can be easily achieved by always using heavyweight popup windows, as explained in my entry on the translucent windows tricks.