• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Set data from arraylist into jtable

 
rahul S Sharma
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am getting data in my ArrayList. Now I want that data to be placed in jtable through AbstractTableModel. How can i achieve this.

regards...
 
Campbell Ritchie
Sheriff
Pie
Posts: 49827
69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I presume you have been through tutorials etc?
 
rahul S Sharma
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ritchie
Thanks for your help. I have gone through the tutorial but didn't find any solution related to my problem. So I would appreciate if you could give some guidelines or any link that can solve my problem....

regards...
 
Rob Spoor
Sheriff
Pie
Posts: 20611
63
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The "Creating a Table Model" section should be able to help you along the way. They use an Object[][], but using a List is not much different.
 
Rob Camick
Ranch Hand
Posts: 2613
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use Row Table Model as a starting point (after reading the Swing tutorial).
 
Haris Tasawar
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes you can... you can simply create a class which extends a table model e.g abstract table model and just implement the table model methods i.e getcolumncount(), getrowcount() and getbvalueat() methods... and you`ll be good to go.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic