Skip to main content

JIC -- Java Icon File Format

Posted by rbair on October 3, 2005 at 4:21 PM PDT

Tired of "dealing with a dozen png representations of a single (logical) icon as separated files"? Tired of writing/debugging the code to treat multiple files as a single logical unit? Well, Daniel Leuck, SwingLabs, and Ikayzo bring you JIC : the simple multi-resolution cross-platform icon format for Java!

Ok, ok, a little dramatic I know. But hey, it's cool technology and cool technology is what SwingLabs is all about. Daniel Leuck from Ikayzo recently contributed some code to the SwingLabs/JDNC Incubator Project for Java(tm) Icons. Read through the source (it's a quick read), as well as this SwingLabs forums posting.

Essentially, JIC is a zip file that contains a series of png or jpg images. All images are named in a standard manner. From the JavaDoc for JIconFile:

Each image has the name "image_(size).(png|jpg)" where (size) is the image size. All images have square dimensions (same width and height.) Variants such as icons with drop shadows are stored within the archive in a folder named after the variant. For example, an icon variant having a drop shadow with a size of 24 should be stored as "shadow/image_24.png". Variant names are all lowercase by convention.

Bam, that's it. As you can imagine, a lot of cool things can be done with this basic structure. Since JIconFile represents the logical icon rather than the physical icon, we can imagine cool utilities for getting grayscaled images (for disabled icons, of course), accessible (large) images, images with badges, etc.

Oh, and by the way, I can't help but plug the awesome icons over at IconExperience. I'm sure these icons (with all their wonderful variations) motivated JIconFile in the first place.

Cool stuff, keep it comin'


Related Topics >>