Hardware

Developer creates Mac UI for Java apps

Java developers may soon be able to get their apps looking less ugly and more Mac-like if a promising new project continues.

Java developers may soon be able to get their apps looking less ugly and more Mac-like if a promising new project continues.

Dubbed "Mac Widgets for Java", the project this week released a Java library to allow developers to create a User Interface(UI) that looks like Mac's across Windows, Linux, Mac, and other platforms with the Java runtime environment installed.

Ken Orr, a developer from MathWorks in Massachusetts, created the Mac UI because he "wanted to see higher fidelity and higher quality Java applications on the Mac."

"I wanted to help the reputation of Java user interfaces on the Mac while giving Mac Java developers a set of straightforward, easy to use widgets that their end users would see as native OS X components," Orr said in an email interview with Builder AU.

"It can be quite time consuming to recreate what Apple offers via Interface Builder. What really made me cringe, though, was seeing poorly designed Mac style components that didn't quite match what OS X offers — user's pick up on the tiniest details like incorrect font sizes or minor differences in color and gradient," Orr added.

The Mac Widgets for Java project was born out of a demo application Orr built in June 2008 as part of his talk at Java One (slides available here, and audio here).

"I wanted a really slick, 'Mac looking' demo application — I ended up writing what would be the beginning of Mac Widgets for Java. The most difficult component to write (thus far) has been the Source List. It's the subtle details, like the faint drop shadow under a Source List categories label text, that consume the majority of development time."

While still in early development — the only supported component released is the Source List — Orr has plans to release more components in the coming weeks including a Unified toolbar, Bottom bar, and Preference tab bar.

"The API was developed with a component-based architecture in mind. Thus my focus was on providing small independent units. I wanted to avoid huge inheritance hierarchies that are all too prevalent in Swing, in an effort to keep the API surface area as small as possible. Using the library may feel awkward for some developers that are used to extension, but I think most will come to find the API refreshingly simple."

Developers can get the code and instructions via Google code, and follow the development of the project here.

Editor's Picks

Free Newsletters, In your Inbox