Jeff Friesen is a prolific Java desktop author on such sites as JavaWorld.com and InformIT.com, and his article on parsing .ico files and exposing the icon planes as BufferedImages. One of the areas mentioned in our JavaOne presentation on high-resolution monitors is scaling the application icons, and the org.jvnet.flamingo.common.icon.ResizableIcon interface aims to provide this support.

It was relatively easy to adapt Jeff’s code and create an implementation of ResizableIcon interface that loads .ico files and chooses the best icon plane for the specific size. The org.jvnet.flamingo.common.icon.IcoWrapperResizableIcon is the implementation and you can see how it is used in the test.imageviewer.IcoViewer.

Here is a screenshot of this application showing file icons from the Jordan Michael‘s portfolio under 128*128 size (click for the full view):

and here is the same application with the icon size changed to 256*256 (click for the full view):

The code for parsing the .ico format has been contributed by Jeff under the BSD license. The following must be referenced if you reuse this code in your application:

Sleepless Nights - What Ails You My Friend?

Next >

This week i have started working on providing Substance plugin for the JIDE common layer components. The main project page contains the overview information on using the early drops of this plugin, and you will need the latest 5.0dev drop of the core library to use the early drops.

At the present time the plugin contains the UI delegate for the JideButton component, complete with what you expect from the Substance look-and-feel:

  • Full animations on rollovers, selections, press etc, including animating both background and foreground colors.
  • Support for high-DPI mode, including margins, insets and borders.
  • Support for decoration areas.
  • Animating the text underline on rollovers over hyperlink-styled buttons.

Here is a screenshot of JideButton components under different settings (click to see full view):

Here is a short video of rollover effects over different button styles. Note the animations on the background colors, translucency and the text underline of hyperlink-styled buttons:



And here is a short video of the rollover effects under the core Magma skin. Note how the foreground colors are animated properly (including the always-white foreground on hyperlink-styled buttons that never show the background fill):



This is just a preview of the features that will be eventually available in the final plugin release. The goal is to provide the full range of Substance functionality for all JIDE common layer components.

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

  • Alexander Potochkin shows how to use the new JXLayer to provide mouse auto-scrolling functionality. I have reviewed the available techniques in an earlier post, and this is yet another illustration of the capabilities of JXLayer.
  • Jeff Friesen has an article that shows how use animated Windows cursors (in.ani format) in Swing applications. This builds on his previous article on extracting images from the Windows .ico files.