The TableBrowser.java Application: the dataTableModel Inner Class

Inner classes in Java provide a very useful syntax to obtain the concise encapsulation of the business logic while still maintaining class scope for the contents of the class. The inner class in this example is used to control the table displayed by the GUI. In this case, the class extends the AbstractTableModel class and overrides certain methods so that they return sensible values for this data model.

The getColumnCount and getRowCount methods return a count of the current number of the rows and columns in the model. These methods map directly to the GeneralAggregateVO object (gvo) stored as an instance member of the application.

The getValueAt method takes an integer row and ...

Get J2EE™ and Beyond: Design, Develop, and Deploy World-Class Java™ Software now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.