Skip to main content

CSS and Swing

Posted by daniel on October 14, 2003 at 11:01 AM PDT

Separating the components that make up your view makes your Swing application more flexible, robust, and maintainable. But that's just a first step. You can also factor out the common elements that define the look for your application in the same way that CSS is used to style a web site.

Sites such as Eric Meyer's css/edge gallery show how far you can push HTML with the help of style sheets. Imagine what you could do if your designers could work out a solid look for your Swing applications and roll it out with a centrally defined style.

That's what Joshua Marinacci recommends in his feature article Swing and CSS . He takes you through steps of identifying and abstracting the styling code from various Swing components. The style specific properties are then stored in an XML file that is parsed by his CSSLoader class.

The Swing and CSS themes continue in Projects and Communities. The Java Desktop community points to the latest Swing SIghtings . The current list of goodies includes ""a pirate game for the kids (Yohoho!), a crossword puzzle game for English language students, not one but two photo gallery apps for digital photo fans, a collaboration tool from "Uncle Dave Moffat", an EBay auction monitor, [and] tools for creating database applications".

The Java Tools community hosts the CSS Editor project. The project aims to provide a tool that will be able to create, add, edit, and validate CSS elements. Recent releases present the first steps of this process.

Today's new Weblog entries highlight Java on Mac OS X from a pair of Simons. Simon Phipps documents NeoOffice/J 0.7 Released . Phipps reports that Patrick Luby "has single-handedly written a highly usable front-end for the Mac OS X port of 1.0.3 [...] so that it doesn't require X11 to use. " Simon Brown's Integrating Tomcat and Apache on Mac OS X points to resources for getting Tomcat and Apache integrated and up and running (it took him 5 minutes) using a prebuilt version of mod_jk for Mac OS X.

In Also in Java Today you are invited to join the Tuesday, October 14 Java Live chat What's New in Javadoc. Join Scott Seligman and Douglas Kramer between 11 am and noon Pacific to talk about what's new in Javadocs in J2SE 1.4. Prabu Arumugam writes about parsing XML in multithreaded applications in his ONJava article XML Parsing in a Producer-Consumer Model.

In today's News Headlines :

Registered users can submit news items for the href=""> News Page using our
news submission form.
All submissions go through an editorial review by news director Steve
Mallet before being posted to the site. You can also subscribe to the href=""> News RSS

Current and upcoming Java Events:

Registered users can submit event listings for the href=""> Events Page using our href=""> events submission form.
All submissions go through an editorial review before being posted to the

This blog is delivered weekdays as the href="">Java Today RSS
feed. Once this page is no longer featured as the front page of href=""> Java Today it will be archived at href=""> You can
access other past issues in the href=""> Archive.