O’Reilly news

"Swing Hacks": Tips and Tools for Killer GUIs

June 23, 2005

Sebastopol, CA--It could be the result of faster computers and faster video cards, but users expect more from interfaces today, certainly more than a web page can deliver. Software developers are feeling the pressure as they hit the technology and interface limitations of web applications. The movement now is toward new desktop software that promises greater integration between the Web, external devices, and PCs--whether it's RSS readers, iPods, photo collaboration, or gaming with servers or cell phones.

"That's the future of desktop software," claims Joshua Marinacci, coauthor of Swing Hacks (Adamson and Marinacci, O'Reilly, US $29.95). "As people use computers more, and as more things fall under the general category of 'computers'--such as cell phones and console game machines--it's our duty as developers to make higher quality software. That means applications should look great, perform well, and be easy to use. Java Swing is a great choice. It gives you the potential to build a richer interface."

Swing Hacks is not an exhaustive compendium on Java Swing, which contains all the classes and components for creating Graphical User Interfaces, but a handy resource for experienced and enthusiastic programmers who want to push the boundaries of what a Java client application can do.

"This book is a reference to the cool stuff," says coauthor Chris Adamson, editor of ONJava and java.net. "We want to show that it's possible and essential to create Java GUIs that are pleasant, even fun to use. Swing is just a small part of desktop Java, but we feel it's the focal point--the place where desktop technology (AWT, Java2D, JavaSound), network technology (web services, XML, JXTA), and device technology (iPods, cell phones, TVs) all converge. Many of the hacks in this book are not strictly about Swing, but about using Swing to do cool things with the rest of the world."

The book contains hacks for using various Swing components, such as trees and tables, windows, dialogs and frames, transparent and animated windows, text components, rendering, drag-and-drop support, audio components, and more. With Swing Hacks, readers will learn how to apply the Swing API in situations that require a more advanced touch. In other words, the book teaches how to use and extend the Swing component set in ways that Swing's originators never imagined--whether it's a visual enhancement to make software look better, or a functional improvement to make software do something it couldn't do before.

"Some of our tricks are meant for fun, but others are meant to show how to do things in Swing as well or better than with native applications," Adamson explains. "We have a number of drag-and-drop hacks--getting URLs and images from native applications, showing translucent drag images--which we think are a great way to work with data, and yet are wildly underused in Swing applications."

Marinacci, who also covers topics in Java client-side and web development in his "Java Sketchbook" column for java.net, adds, "After years of working with Swing, you start to learn what the API is good at and what it lacks. Some days you learn something that makes your life as a developer easier. That's what we put into this book. Some days you learn a workaround for a long-standing bug or a missing feature that you've been dying to have. We put that stuff in the book, too. It's about the interesting things you learn over the years, the weird hacks that make you say, 'I didn't know you could even do that!'"

As with all books in O'Reilly's Hack Series, each hack stands on its own, giving readers the freedom to browse sections that interest them most. Each hack in the book also has a thermometer icon to indicate its relative complexity: beginner, moderate, or expert.

"We hope 2005 will be a watershed year for Java on the desktop," Marinacci says. "Apple just announced that they are switching from PowerPC chips to Intel. All native applications will have to be recompiled, but Swing applications will work right away with no changes whatsoever. I think that says a lot about the strength of writing one-hundred percent Java applications. If you buy our book, you will be able to make your applications look and feel cooler. Period."

Additional Resources:

Swing Hacks
Joshua Marinacci and Chris Adamson
ISBN: 0-596-00907-0, 544 pages, $29.95 US, $41.95 CA
order@oreilly.com
1-800-998-9938; 1-707-827-7000

About O’Reilly

O’Reilly Media spreads the knowledge of innovators through its books, online services, magazines, and conferences. Since 1978, O’Reilly Media has been a chronicler and catalyst of cutting-edge development, homing in on the technology trends that really matter and spurring their adoption by amplifying “faint signals” from the alpha geeks who are creating the future. An active participant in the technology community, the company has a long history of advocacy, meme-making, and evangelism.

Email a link to this press release