aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Two Jtables with abstract table model methods Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Two Jtables with abstract table model methods" Watch "Two Jtables with abstract table model methods" New topic
Author

Two Jtables with abstract table model methods

Haris Tasawar
Ranch Hand

Joined: Aug 19, 2011
Posts: 30
Hey all,
I need to display basically 3 jtables in one class using using hibernate and extending the class with abstracttablemodel. The problem is that i need to know how to use the abstract table model methods i.e getrowcount(), getcolumncount(), getvalueat() .... for all the three different jtables. Is it possible somehow? If its not the what should be the workaround for this???


Thanks,
Haris Tasawar.
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2203
    
    7
I would start by using the DefaultTableModel. Then you don't have to worry about implementing your own custom TableModel.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18669
    
    8

And if you do decide to use AbstractTableModel, and you need three different table models, then the obvious way to implement that would be to write three table-model classes which extended AbstractTableModel.
Haris Tasawar
Ranch Hand

Joined: Aug 19, 2011
Posts: 30
Thanks for your replies guys...... i will start the classes implementation straight away.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Two Jtables with abstract table model methods