Buying Options
Swing Hacks
Print $29.95
Add to Cart
Print+Ebook $32.95
Add to Cart
Ebook $23.99
(PDF)
Add to Cart
Safari Books Online
Add to Cart
What is this?
Print £22.99
Add to Cart
What is this?
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
Table of Contents
  1. Chapter 1 Basic JComponents

    1. Hacks 1–12: Introduction

    2. Create Image-Themed Components

    3. Don't Settle for Boring Text Labels

    4. Fill Your Borders with Pretty Pictures

    5. Display Dates in a Custom Calendar

    6. Add a Watermark to a Text Component

    7. Watermark Your Scroll Panes

    8. Put a NASA Photo into the Background of a Text Area

    9. Animate Transitions Between Tabs

    10. Blur Disabled Components

    11. Building a Drop-Down Menu Button

    12. Create Menus with Drop Shadows

    13. Add Translucence to Menus

  2. Chapter 2 Lists and Combos

    1. Hacks 13–20: Introduction

    2. Filter JLists

    3. Add a Filter History

    4. Make JLists Checkable

    5. Make Different List Items Look Different

    6. Reorder a JList with Drag-and-Drop

    7. Animate Your JList Selections

    8. Turn Methods into List Renderers

    9. Create a Collections-Aware JComboBox

  3. Chapter 3 Tables and Trees

    1. Hacks 21–27: Introduction

    2. Size Your Columns to Suit Your JTable's Contents

    3. Add Column Selection to JTables

    4. Let Your JTables Do the Sorting

    5. Create a JDBC Table Model

    6. Export Table Data to an Excel Spreadsheet

    7. Search Through JTables Easily

    8. Animate JTree Drops

  4. Chapter 4 File Choosers

    1. Hacks 28–32: Introduction

    2. Add a Right-Click Context Menu to the JFileChooser

    3. Display Shortcuts in the JFileChooser

    4. Real Windows Shortcut Support

    5. Add Image Preview to File Choosers

    6. Preview ZIP and JAR Files

  5. Chapter 5 Windows, Dialogs, and Frames

    1. Hacks 33–40: Introduction

    2. Window Snapping

    3. Make a Draggable Window

    4. Add Windows Resize Icons

    5. Add Status Bars to Windows

    6. Save Window Settings

    7. Earthquake Dialog

    8. Spin Open a Detail Pane

    9. Minimize to a Mini-Frame

  6. Chapter 6 Transparent and Animated Windows

    1. Hacks 41–47: Introduction

    2. Transparent Windows

    3. Make Your Frame Dissolve

    4. Create Custom Tool Tips

    5. Turn Dialogs into Frame-Anchored Sheets

    6. Animating a Sheet Dialog

    7. Slide Notes Out from the Taskbar

    8. Indefinite Progress Indicator

  7. Chapter 7 Text

    1. Hacks 48–55: Introduction

    2. Make Text Components Searchable

    3. Force Text Input into Specific Formats

    4. Auto-Completing Text Fields

    5. Write Backward Text

    6. Use HTML and CSS in Text Components

    7. Use Global Anti-Aliased Fonts

    8. Anti-Aliased Text Without Code

    9. Anti-Aliased Text with a Custom Look and Feel

  8. Chapter 8 Rendering

    1. Hacks 56–64: Introduction

    2. Create a Magnifying Glass Component

    3. Create a Global Right-Click

    4. Block a Window Without a Modal Dialog

    5. Create a Color Eyedropper

    6. Changing Fonts Throughout Your Application

    7. Load New Fonts at Runtime

    8. Build a Colorful Vector-Based Button

    9. Add a Third Dimension to Swing

    10. Turn the Spotlight on Swing

  9. Chapter 9 Drag-and-Drop

    1. Hacks 65–69: Introduction

    2. Drag-and-Drop with Files

    3. Handle Dropped URLs

    4. Handle Dropped Images

    5. Handling Dropped Picts on Mac OS X

    6. Translucent Drag-and-Drop

  10. Chapter 10 Audio

    1. Hacks 70–78: Introduction

    2. Play a Sound in an Applet

    3. Play a Sound with JavaSound

    4. Play a Sound with Java Media Framework

    5. Play a Sound with QuickTime for Java

    6. Add MP3 Support to JMF

    7. Build an Audio Waveform Display

    8. Play Non-Trivial Audio

    9. Show Audio Information While Playing SoundHack

    10. Provide Audio Controls During Playback

  11. Chapter 11 Native Integration and Packaging

    1. Hacks 79–87: Introduction

    2. Launch External Programs on Windows

    3. Open Files, Directories, and URLs on Mac OS X

    4. Make Mac Applications Behave Normally

    5. Control iTunes on Mac OS X

    6. Control iTunes Under Windows

    7. Construct Single-Launch Applications

    8. Stuff Stuff in JARs

    9. Make Quick Look and Feel Changes

    10. Create an Inverse Black-and-White Theme

  12. Chapter 12 Miscellany

    1. Hacks 88–100: Introduction

    2. Display a Busy Cursor

    3. Fun with Keyboard Lights

    4. Create Demonstrations with the Robot Class

    5. Check Your Mail with Swing

    6. Don't Block the GUI

    7. Code Models That Don't Block

    8. Fire Events and Stay Bug Free

    9. Debug Your GUI

    10. Debug Components with a Custom Glass Pane

    11. Mirror an Application

    12. Add Velocity for Dynamic HTML

    13. Get Large File Icons

    14. Make Frames Resize Dynamically

  1. Colophon

View Full Table of Contents
Product Details
Title:
Swing Hacks
By:
Joshua Marinacci, Chris Adamson
Publisher:
O'Reilly Media
Formats:
  • Print
  • Ebook
  • Safari Books Online
Print Release:
June 2005
Ebook Release:
June 2009
Pages:
544
Print ISBN:
978-0-596-00907-6
| ISBN 10:
0-596-00907-0
Ebook ISBN:
978-0-596-10538-9
| ISBN 10:
0-596-10538-X
Customer Reviews
About the Authors
  1. Joshua Marinacci

    Joshua Marinacci is the author of "The Java Sketchbook" column for java.net, covering topics in Java client-side and web development. A Java programmer since 1995, he's currently working on enterprise document management software. Joshua earned his BS from Georgia Tech in 1997, and has been a professional programmer for over a decade.

    View Joshua Marinacci's full profile page.

  2. Chris Adamson

    Chris Adamson is the Associate Online Editor for the O'Reilly web sites ONJava.com and java.net, and is the author of O'Reilly's QuickTime for Java: A Developer's Notebook. His consulting company, Subsequently & Furthermore, Inc., specializes in Java media development. Chris has a BA and BS from Stanford University and an MA from Michigan State University.

    View Chris Adamson's full profile page.

Colophon

Our look is the result of reader comments, our own experimentation, and feedback from distribution channels. Distinctive covers complement our distinctive approach to technical topics, breathing personality and life into potentially dry subjects.

The tool on the cover of Swing Hacks is a reflex mallet. Doctors most commonly use reflex mallets to test a patient's "knee-jerk" reaction, which indicates the integrity of the spinal cord in the lower back region. A reflex is a simple nerve circuit, and when tapped by a reflex mallet, sensory neurons send signals to the spinal cord. Reflex tests are part of a neurological exam, and they can be helpful in testing the presence and location of spinal cord injuries or neuromuscular disease.

Marlowe Shaeffer was the production editor and proofreader for Swing Hacks. Derek Di Matteo was the copyeditor. Sarah Sherman and Claire Cloutier provided quality control. Ellen Troutman-Zaig wrote the index.

Ellie Volckhausen designed the cover of this book, based on a series design by Edie Freedman. The cover image is a photograph from photos.com. Karen Montgomery produced the cover layout with Adobe InDesign CS using Adobe's Helvetica Neue and ITC Garamond fonts.

David Futato designed the interior layout. This book was converted by Keith Fahlgren to FrameMaker 5.5.6 with a format conversion tool created by Erik Ray, Jason McIntosh, Neil Walls, and Mike Sierra that uses Perl and XML technologies. The text font is Linotype Birka; the heading font is Adobe Helvetica Neue Condensed; and the code font is LucasFont's TheSans Mono Condensed. The illustrations that appear in the book were produced by Robert Romano, Jessamyn Read, and Lesley Borash using Macromedia FreeHand MX and Adobe Photoshop CS. This colophon was written by Marlowe Shaeffer.

  • Book cover of Swing Hacks