BUY THIS BOOK
Add to Cart

Print Book $29.95


Add to Cart

Print+PDF $38.94

Add to Cart

PDF $23.99

Safari Books Online

What is this?

Add to UK Cart

Print Book £20.95

What is this?

Looking to Reprint or License this content?

Swing Hacks Tips and Tools for Killer GUIs

By Joshua Marinacci, Chris Adamson
June 2005
Pages: 542
Series: Hacks
ISBN 10: 0-596-00907-0 | ISBN 13: 9780596009076
starstarstarstarstar (Average of 5 Customer Reviews)

Buy 2 Get 1 Free Free ShippingGuarantee

Book description

Swing Hacks helps Java developers move beyond the basics of Swing, the graphical user interface (GUI) standard since Java 2. The unique Hacks format provides short advanced tricks that you can instantly apply to increase your competency with interface-building tools. Example hacks include how to filter lists, power-up trees and tables, and add drag-and-drop support.
Full Description

Swing Hacks helps Java developers move beyond the basics of Swing, the graphical user interface (GUI) standard since Java 2. If you're a Java developer looking to build enterprise applications with a first-class look and feel, Swing is definitely one skill you need to master. This latest title from O'Reilly is a reference to the cool stuff in Swing. It's about the interesting things you learn over the years--creative, original, even weird hacks--the things that make you say, "I didn't know you could even do that with Swing!" Swing Hacks will show you how to extend Swing's rich component set in advanced and sometimes non-obvious ways. The book touches upon the entire Swing gamut-tables, trees, sliders, spinners, progress bars, internal frames, and text components. Detail is also provided on JTable/JTree, threaded component models, and translucent windows. You'll learn how to filter lists, power-up trees and tables, and add drag-and-drop support. Swing Hacks will show you how to do fun things that will directly enhance your own applications. Some are visual enhancements to make your software look better. Some are functional improvements to make your software do something it couldn't do before. Some are even just plain silly, in print only to prove it could be done. The book will also give you give you a small glimpse of the applications coming in the future. New technology is streaming into the Java community at a blistering rate, and it gives application developers a whole new set of blocks to play with. With its profusion of tips and tricks, Swing Hacks isn't just for the developer who wants to build a better user interface. It's also ideally suited for client-side Java developers who want to deliver polished applications, enthusiasts who want to push Java client application boundaries, and coders who want to bring powerful techniques to their own applications. Whatever your programming needs, Swing Hacks is packed with programming lessons that increase your competency with interface-building tools.

Browse within this book

Cover | Table of Contents | Colophon




Featured customer reviews

Write a Review


have bug in hacker#11-12,  July 09 2008
Submitted by Steven   [Respond | View]

the examples in hack #11-12 can't run
because it get exception in UIManager.put(..)




<exception here>
UIDefaults.getUI() failed: no ComponentUI class for: javax.swing.JPopupMenu[,0,0,0x0,invalid,alignmentX=0.0,alignmentY=0.0,border=,flags=0,maximumSize=,minimumSize=,preferredSize=,desiredLocationX=0,desiredLocationY=0,label=,lightWeightPopupEnabled=true,margin=,paintBorder=true]
java.lang.Error
at javax.swing.UIDefaults.getUIError(Unknown Source)
at javax.swing.MultiUIDefaults.getUIError(Unknown Source)
at javax.swing.UIDefaults.getUI(Unknown Source)
at javax.swing.UIManager.getUI(Unknown Source)
at javax.swing.JPopupMenu.updateUI(Unknown Source)
at javax.swing.JPopupMenu.<init>(Unknown Source)
at javax.swing.JPopupMenu.<init>(Unknown Source)
at javax.swing.JMenu.ensurePopupMenuCreated(Unknown Source)
at javax.swing.JMenu.add(Unknown Source)
at swing.jcomponent.MenuTest.main(MenuTest.java:24)
UIDefaults.getUI() failed: no ComponentUI class for: javax.swing.JPopupMenu[,0,0,0x0,invalid,alignmentX=0.0,alignmentY=0.0,border=,flags=0,maximumSize=,minimumSize=,preferredSize=,desiredLocationX=0,desiredLocationY=0,label=,lightWeightPopupEnabled=true,margin=,paintBorder=true]
java.lang.Error
at javax.swing.UIDefaults.getUIError(Unknown Source)
at javax.swing.MultiUIDefaults.getUIError(Unknown Source)
at javax.swing.UIDefaults.getUI(Unknown Source)
at javax.swing.UIManager.getUI(Unknown Source)
at javax.swing.JPopupMenu.updateUI(Unknown Source)
at javax.swing.JPopupMenu.<init>(Unknown Source)
at javax.swing.JPopupMenu.<init>(Unknown Source)
at javax.swing.JMenu.ensurePopupMenuCreated(Unknown Source)
at javax.swing.JMenu.add(Unknown Source)
at swing.jcomponent.MenuTest.main(MenuTest.java:30)



Fun...love it...lets see another,  August 29 2007
Rating: StarStarStarStarStar
Submitted by Anonymous Reader   [Respond | View]

I bought this book when if first came out. I love it. I wonder if these other reviewers simply had the wrong expectations. I still like to read it, years later. It is inspiring. Getting under the hood of Swing is fun, and this book does a great job.

I would like to see more complete code examples in the download. But more importantly I'd like to see another book!

Good work.


Disappointed...,  December 19 2006
Rating: StarStarStarStarStar
Submitted by Anonymous Reader   [Respond | View]

I couldn't agree with this review more. The ideas in the book are great but its pretty much useless without the examples. Hack #36 is completely missing from

http://examples.oreilly.com/swinghks/swing-hacks-examples-20060109.zip

Me thinks that's pretty shitty on ora's part.

Read all reviews


This book is exactly what the title says,  October 25 2006
Rating: StarStarStarStarStar
Submitted by Swing Hacker!   [Respond | View]

Right in the beginning of the book it states that some of the examples in this book "are just plain silly, in print only to prove it could be done".

However, I have found that most of the examples in this book (even if they seem silly at first) are real eye-openers to possible ideas for my own Swing applications.

If you use the book code as it was written, it probably won't do what you want. But since this is a book about hacks, keep hacking the code and you will get what you want (as even suggested in the text for most of the hacks in the book)!

This book does assume some knowledge of Swing, but I don't know why anyone who has never written a serious Swing app would be looking at this book in the first place. For those of us that have (and still are) writing Swing apps, this book is a godsend. I just wish it had more hacks, like how to get an IconImage to appear in the title of a non-resizable JDialog!


Disappointed...,  December 31 2005
Rating: StarStarStarStarStar
Submitted by ZacWolf   [Respond | View]

I've got to say this is my only experience with a bad O'REILLY book!

After a very quick review at my local bookstore, I was very excited with the various hack descriptions.

I'm thinking that's apparently the exact thing that happened to the editor, because when you get into the actual guts of the various "hacks" you find them to be more "kludge" than anything useful.

I'm most disappointed with the "examples" zip you can download, as it seems to be missing over half of the images used in the book which makes the example code fairly useless if you want to replicate the figures from the book.

All and all, there are some useful tidbits that you can get out of the material, but it's nowhere near the "reference" quality I'm used to seeing in O'REILLY books.

Maybe I was looking for something along the O'REILLY "Cookbook" line of books, that focus on reference quality code examples.

I have to admit that the book does clearly say "Tips & Tools" right on the cover, but I'd say it leans more towards Tips than real Tools.

Just be aware,
-Zac Morris
www.zacwolf.com




Finally -- an advanced Swing book,  August 05 2005
Rating: StarStarStarStarStar
Submitted by Ronald Hughes   [Respond | View]

Awesome. This is a Swing book unlike any other.
It doesn't regurgitate the entire API for every
Swing widget -- there are lots of other books that
do that -- but rather, this book provides particular
complete pieces of code that do AMAZING things.
Some show how easily to create cool visually rich
customizations that work the way Swing was designed
to be used, while others are clever tricks that do
stuff that the Swing designers obviously never
intended!

I love the way the examples are minimal yet
complete. It's code that can easily be hacked
into an already-existing application.

It's time for Java apps to surge back onto the
desktop. This book is gonna help make that happen.



Media reviews
"Instead of listing the lengthy API in Swing, the book is filled with delightful examples that cover many, if not all topics that are essential to user interface. Most of the tips in the book go beyond the standard requirements for business applications. Applying any of the tricks in this book will spice up your applications and make them stand out among the crowd...This is a rich collection of various tips on using Swing. It is one of the few books that one would want to keep on the desktop for handy reference. Any GUI developer using Java will find that this is an indispensable companion for development. Highly recommended."
-- Songmuh Jong, KickStartNews.com



Read all reviews

See larger cover


"Applying any of the tricks in this book will spice up your applications and make them stand out among the crowd."
--Songmuh Jong, KickStartNews.com