Supporting wide variety of font sizes in modern UI toolkits is a necessity. Toolkits such as Qt, Swing, JavaFX and more are targetting not only multiple desktop operating systems, but multiple devices spanning TV sets and mobile phones. They must take into consideration the significant span of device DPI settings, in addition to more niche areas such as point of sale applications and presentation demoes.

One of the main goals of Substance look-and-feel is to provide appealing visuals for Swing applications, and that includes honoring the current desktop configuration, including font and DPI settings. Even if at the present moment the vast majority of monitors support a rather narrow DPI band (from 72 to around 200 DPI), this still requires the UI toolkit to adapt the control visuals to have the same physical size across the different environments. In addition, point of sale applications pose more challenges as they are operated in a busy environment using manual (finger) interaction.

As such, Substance continues to pay close attention not only to the usual setups (ranging from Tahoma 11 in Windows XP to Lucida Grande 13 in OS X). Version 4.3 has made the first step towards ensuring that the core Swing controls are painted correctly under large font sizes (around 72 points), and version 5.1 provides support for even more controls.

The following screenshot shows a 72 point combobox with the mouse over the arrow button under Substance 5.0:

And here is the same combobox under Substance 5.1:

The top-right and bottom-right corners of the button are no longer out of sync, with the top-left and bottom-left corners having a perfect straight connection.

The next screenshot shows a 72 point progress bar under Substance 5.0:

And here is the same progress bar under Substance 5.1:

Here the border outline of the selected part has the correct stroke width, as well the right alignment with the inner gradient fill.

Finally, the next screenshot shows a 72 point slider with mouse over the thumb under Substance 5.0:

And here is the same slider under Substance 5.1:

The slider main ticks are no longer clipped on the left, the thumb downward mark is centered on the matching main tick, and the inner contour of the slider thumb is correctly centered.

This work will continue in the next releases to make sure that all core Swing controls look correctly under different font sizes, including very large values such as shown in this entry. In the meantime, you’re welcome to take the latest 5.1dev drop of core Substance (code-named Panama). Release candidate for Substance is scheduled for January 26 and the final release is scheduled for February 9.

Jitterbug is a visual editor for creating and editing color schemes in Substance look-and-feel. It primarily addresses the scenarios where you need to translate design mockups or emulate existing UI visuals as a Substance skin. Created during the rework of the Office Blue skin, it was used to create and refine all seventeen color schemes currently used in this skin.

The following screenshot shows Jitterbug in action (click to see full size view):

To see the Jitterbug in action, run the following signed WebStart demo:

Here i would like to ask for your feedback. This tool was created to scratch my own itch – it was getting quite tedious creating and tweaking color schemes. I did try to make both flows straightforward and intuitive. However, i cannot be an objective judge of my own creation. As such, i am not detailing any instructions on how to use Jitterbug. If you find yourself stuck in the middle of the process, or the flows do not simply make sense, let me know in the comments.

Pushing Pixels: the best of 2008

December 30th, 2008

The year is coming to an end, and it’s time to review what has happened on this blog over the last twelve months. I’ll start with the list of top ten most read posts, continue with the my own top ten favorites, and finish with the list of eleven interviews that i have conducted over this year.

Let’s start with the top ten most read posts published in 2008 as measured by Google Analytics:

  1. Translucent and shaped windows in core Java talks about the new AWTUtilities class in 6u10 and support for modern top-level windows effects. Published in February, has around 13,800 reads.
  2. Party Of One: Surviving A Hobby Open-Source Project talks about the specifics of one-man open-source projects and how to maintain a long-term level of commitment. It is the first of five part series on the subject. Published in May, has around 10,000 reads. The entire series has around 16,700 reads.
  3. Swing, RIA and JavaFX – interview with Amy Fowler. Amy delves deep into the reasons behind the work on JavaFX, and where Swing fits into the future of client side Java. Published in May, has around 8,100 reads.
  4. Sun setting down on the core Swing contains my thoughts on the demise of the core Swing as the primary Java desktop toolkit developed and promoted by Sun. Published in November, has around 7,200 reads.
  5. Swing applications and Mac OS X menu bar shows how Swing application under non-Apple look-and-feel can place their menus on the system menu bar. Published in July, has around 3,600 reads
  6. More tricks with translucent Swing windows follows up with the different effects achievable with the new translucent window support. Published in March, has around 3,300 reads.
  7. Java on the Desktop, the past, the present and the future – interview with Richard Bair. Richard provides his point of view on where the desktop Java is heading. Published in December, has around 3,300 reads.
  8. Trust is hard to build and easy to destroy is a followup to the state of core Swing and addresses the lack of transparency that Sun has shown towards the desktop community. Published in November, has around 3,200 reads.
  9. Native video codecs and Flash content with JMC shows how to use JMC to play back video files in Swing. Published in July, has around 2,900 reads.
  10. Soft clipping and per-pixel translucency for Swing windows is yet another entry that explores the translucent effects on top-level windows in Swing with 6u10+. Published in March, has around 2,900 reads. All together, the three articles on the subject have around 20,000 total reads.

While these have been the readers’ favorites, a few entries that didn’t enjoy a wider readership are worth highlighting. These are my personal favorites that were published in 2008:

  1. Trust is hard to build and easy to destroy is the only entry from the “most popular” list that is going to appear here. Addressing the lack of transparency that Sun has shown towards the desktop community makes it the most important posting of the year in my eyes.
  2. 20 design blogs for UI developers aims to collect links for those readers that wish to learn from the best minds on the other side of the fence that still divides developers and designers.
  3. Is this the future of the enterprise applications? has been the driving force behind most of the design decisions and pixel pushing made in Substance and Flamingo over the last year, as evidenced here, here and here.
  4. Problem solving and innovation tries to warn against pursuing solutions just for the sake of innovation. If you are the only talking about how innovative your product is, you’re not solving your users’ problems.
  5. Java on the desktop talks about my favorite Swing application of the year – Woopra desktop client.
  6. Matching desktop fonts and native font rasterization talks about two major problems with the core Swing look-and-feels that significantly hamper usability of Swing applications.
  7. Native text rendering in Swing applications – ready, steady, go! has predated the native font rasterization in 6u10 by a few months and has shown how SWT can be leveraged to address the specific Swing deficiency in pre-6u10 VMs.
  8. Stricter checks on EDT violations in Substance is by far the most controversial decision that i have made in Substance 5.0+. It highlights yet another weakness of core Swing, and the number of Substance queries (going well into dozens) just highlights how low is the level of the subject awareness in the general developer community.
  9. From Photoshop to code – conclusion is the last in the six-piece series on using Substance skinning APIs to implement a rich custom UI mocked in Photoshop.
  10. Effective Java2D is a collection of tips from my work on bringing Substance performance in version 5.0 to be on par with other active core and third-party look-and-feels.

Finally, this year has seen a number of interviews with the people from Sun, as well as the Java desktop community.

  1. Alexey Utkin – this is where it all started. It is rather unfortunate that JDICPlus has not made it through the end of the year.
  2. Amy Fowler – should be quite an interesting read in a couple of years as well, just to see how Amy’s predictions have played out.
  3. Mikael Grev from MigLayout and MigCalendar.
  4. David Qiao from JIDE.
  5. Chet Haase just after his move to Adobe.
  6. Andres Almiray and his many Groovy UI projects.
  7. Don DeCoteau from Sage.
  8. Richar Bair from JavaFX and SwingLabs.
  9. Sam Berlin from LimeWire.
  10. Alex Ruiz from FEST.
  11. Elie El Khoury from Woopra.

This year has also seen the number of RSS subscribers grow from 500 to around 1,400. If you still have not subscribed, click on the icon below to stay tuned in 2009! Happy New Year!

Woopra desktop client is my favorite Swing application of the year, and it’s time to meet its creator – Elie El Khoury, as the Java desktop spotlight that has started with Don DeCoteau and Sam Berlin continues.

Tell us a little bit about yourself.

Elie Khoury - Photo by Sara SfeirMy name is Elie El Khoury, 23 years old. I live in the ancient city Byblos of Lebanon. Programming has been my hobby for more than 10 years. I was introduced to Java 5 years ago at the Lebanese American University which was the first university in Lebanon to teach Java as a main language.

I love Graphical User Interfaces and Graphic Design, that’s why I switched to Mac. I run a personal blog at http://www.ekhoury.com that I maintain in my free time.

Besides computing, I’m a guitarist. I taught Blues Guitar and Jazz Theory and was part of a couple of bands.

What is your “elevator pitch” for Woopra?

woopra1Woopra is a web tracking and analytics service for bloggers and online businesses. It’s a Swing based desktop application that shows you what’s happening on your website in real time. Unlike other analytics services, you don’t need to refresh pages to get updates, you see instant statistics on a TV like interface.

What’s even cooler about Woopra is the Instant Notifications. A website owner can setup as many notification filters as they want and get notified as they occur. There are infinite filters combinations you can setup for all kinds of actions that might occur on your website!

Fore more information about Woopra, visit our a little bit outdated features page on the Woopra website.

In the age where browser-hosted solutions are mature enough to provide rich user experience, why did you decide to use Swing for the main Woopra client?

It’s true that the browsers today can handle very rich applications, but we cannot forget that the limitations are still endless and the browsers were never meant to handle heavy weight client applications like Woopra.

Before starting the development of Woopra, it was a very tough decision to take. The only advantage for having a web based application is the accessibility. You don’t need to download the Woopra application as you go, but our clients are the kind of people who carry their laptops (they are webmasters), so I would sacrifice accessibility for the different advantages provided by a desktop application (Desktop notifications, sockets, cross-domain connections, load on startup, sit in systray, reliability, speed, more interaction etc…).

I believe the browser is not yet ready to handle apps like Woopra. We all know how much time it takes to create an application that looks the same on IE6 and Firefox, is it worth it? But if I was to work on a Facebook like platform, I’d definitely go for a browser based solution because users would need to access it on public computers.

To add something, check out Twitter! Everyone is using a desktop application to tweet, this is another proof that people enjoy the desktop based experience much more.

As for why Swing not .Net for example? My simple answer is that I adore Swing and Java in general, and of course, the need to create a cross platform application.

Why do we not see more Swing-based user facing applications?

woopra2I believe it’s because the unattractive look and feel provided by Sun. Performance is no longer an issue with today’s hardware, but people want to see good-looking things. Adobe Air has done it correctly. You cannot make an ugly application with Adobe Air because they provide you with amazing UI Kits. With Java, it’s very easy to come up with a very ugly application, but what they don’t know is how much Swing is customizable.

Sun should consider working on the “Look and feel” aspect more in Swing. JavaFX is one solution but not the ultimate for Swing lovers.

What are Swing’s weak points?

Swing’s weak points are not many. But I would say that AWT is better in terms of native dialogs. I prefer the FileChooser instead of the JFileChooser because AWT’s is native. Also, the Anti Aliasing is really weak in Java. It looks different from a platform to another. Adobe Air has done it better!

Not to forget the look and feel, that is the major weakness of Swing.

What functionality is missing from core Swing, and would you want to see third-party libraries folded into the core distribution?

The JWebPane of course as mentioned by Sam Berlin of LimeWire. I’m glad they are working on it and have chosen the WebKit renderer. But I don’t believe we will be able to use it before a year of its release unless they provide it as a standalone API. People using PowerPC cannot even run Java 1.6 applications yet, we had to downgrade the application to work with Java 1.5 which is missing a lot of new interesting features like SysTray and more desktop tools.

What I’d like to see more with Swing is the window transparency for example, and the ability to create windows with custom shadows and rounded corners. ( I think that’s is now available with JavaFX).

Another interesting missing feature is the blinks in the task manager and the bounces in Mac OS X. There should be a simple function for the JFrame to do that.

One last missing feature in Swing and DesktopTools is the ability to change the screen insets. I would love to create an always on top floating window on the right just like Windows Vista’s Sidebar. I can imagine Woopra on the sidebar and always on top, showing live stats without intruding on other application (This is doable at the moment but we cannot change the screen insets). That would be awesome.

Woopra client has great responsiveness and excellent non-intrusive animations. How easy was it to code this functionality in Swing?

Almost 99% of the components you see in Woopra extend JComponent. I spend most of my time painting components. I spend sometimes hours testing colors, gradients on a simple simple button. Graphics2D is an amazing class that allows you to create whatever you need for your application. I didn’t really rely on the Swing components, I created my own layouts, buttons. You can easily notice that all the components are selfmade.

Do you have any plans to extract the Woopra skinning layer to a standalone look-and-feel library?

No, since I’m extending swing not skinning it.

Woopra client looks like a perfect candidate to be ported to JavaFX, the new direction of client Java. What are your thoughts on this topic?

I haven’t explored JavaFX a lot yet but I think it’s too late now to switch to JavaFX. I’d rather have more control over the animation and drawing. Swing is really huge and I’m learning more and more everyday about that package. I’m afraid Sun would consider JavaFX as Swing 2 and stop their core swing development. JavaFX and Swing should be parallel projects.

Anything else that you would like to add?

woopra3I’d be happy to develop Look and Feels for Swing, but I wish there are enough documentation on the web to do so.

Woopra 1.3 is close to be released which is more interactive, attractive, fast and optimized.

I want to thank you for interviewing me and I want to salute the other people behind Woopra today: Jad Younan, John Pozadzides, Vi Kim Vu, Lorelle VanFossen and Chris Patton.