| Author |
JTables
|
Mike Southgate
Ranch Hand
Joined: Jul 18, 2003
Posts: 183
|
|
Quick general question for some of you more advanced guys. When using JTables do you generally use DefaultTableModel or extend AbstractTableModel and why? I always do the latter. ms
|
ms<br />SCJP, SCJD
|
 |
jefff willis
Ranch Hand
Joined: Sep 29, 2004
Posts: 113
|
|
I like writing my own table model (AbstractTableModel) because it is necessary if you want to display or interact with the table in an "expected manner." Of course this is just my opinion, however I find that most of my tables are populated with strings, ints, doubles, booleans, etc. I want my doubles displayed to a particular precision. I want my numbers right justified, I want my boolean variables to show up as check marks and not as text, I want my text left justified, etc. Also, most of my tables are NOT for display uses only. There is typically some user interaction with them. I want to be able to pick and choose which columns are editable. I want a drop down list for some columns and to force numerical entries in others. The uses of writing your own table model are seemingly endless.
|
 |
Don Kiddick
Ranch Hand
Joined: Dec 12, 2002
Posts: 580
|
|
|
Generally I use AbstractTableModel. This is mainly because I usually don't want to use a Vector of Vectors to store my cell value objects.
|
 |
 |
|
|
subject: JTables
|
|
|