Summary

Java > Core SWING advanced programming > 6. CREATING CUSTOM TABLE RENDERERS

 

Chapter 6. CREATING CUSTOM TABLE RENDERERS

Topics in this Chapter

  • Rendering Basics

  • Implementing a Custom Renderer

  • Calculating Column Widths

  • Table Striping

  • Multi-Line Header and Cell Rendering

  • Renderers and Tooltips

J Table is one of the most important components in the Swing toolkit. With very little effort, you can use it to display rows of column-centric data to the user. However, sophisticated users expect more than the relatively simple presentation that you get from the default behavior of JTable. In this chapter and the next, you'll see how to use the rendering and editing techniques provided by JTable to change its behavior in several ways. Although these mechanisms are inherently very simple, they are also extremely flexible and, with a little work, you can produce some very impressive effects. Best of all, in most cases, you can implement renderers and editors that are generic enough that they can be considered as separate building blocks that can be used to apply a particular effect to an existing table. With good design, you can even create renderers that can be used in combination with others to add several enhancements at one time.

 

 



Core Swing
Core Swing: Advanced Programming
ISBN: 0130832928
EAN: 2147483647
Year: 1999
Pages: 55
Authors: Kim Topley

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net