Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

TableModel of a JTable  RSS feed

 
Sergio Zuniga
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a doubt about the tablemodel. I've always seen (in examples on the web) that the table models are contructed by an object Object[][]..
In need to make a table from a various lists.I have to convert the lists to Object[][] ??? or there is a way to directly put the lists in the model??

thanks
 
Eric Snell
Greenhorn
Posts: 28
Java Mac MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One way is to subclass AbstractTableModel, contain references to your various lists in your new class, and access those lists as appropriate from the methods you must override to implement AbstractTableModel.
 
Sergio Zuniga
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, i get your point. I've implemented the AbstractTablemodel, but i just dont't get how to put the lists into the model, any aexample ??
Thanks
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!