Using Swing’s JTable
Many applications need to display data in a tabular form, and Swing provides a table component (also sometimes called a grid) that allows you to do so. The JTable class, defined in the javax.swing package, provides a great deal of functionality that you can use to create a user interface for viewing and updating data. This chapter covers some of the functionality that’s commonly needed when using a table component and illustrates how to implement it using JTable. In the process, you’ll learn a great deal about how JTable works, how to use its existing capabilities, and how to extend its capabilities.
In this chapter, ...