Hi, welcome to Swing Hacks! This book is a reference, but not a complete
reference of the Swing API. We already have that. It’s called Java Swing, is
published by O’Reilly, and weighs in at over 1,200 pages. It’s available for
purchase at fine bookstores and Russian black market web sites every-
where. We’re not saying that it isn’t a great book. It’s fantastic! We’ve
owned many weathered copies over the years. The problem is…it’s huge!
This isn’t really the book’s fault: Swing itself is huge. I once saw an API dia-
gram that took an entire 30-inch poster. Swing is powerful, but it takes a
long time to explore fully, simply because it is so big. That’s not what this
book is about.
This book is a reference to the cool stuff. 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!” After years of working with Swing, you start to
learn what the API is good at and what it lacks. Some days you learn some-
thing that makes your life as a developer easier, a way to do something
quicker than the standard route. 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. Some-
times it’s something fun—an interesting API that makes us think, “Well, if
we were evil what could we do with it?” This is usually followed by the pin-
kie up to the mouth and cackling that can be heard outside our under-
ground lair. After much consultation with lawyers and gods, we slipped
some of these into the book, too.