• Post Reply Bookmark Topic Watch Topic
  • New Topic

trouble with JTable

 
johny sill
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am taking data from database,(Came as ArrayList)

Then i put this data (ArrayList) in vector

then i use DefaultTableModel and set this data using setDataVector(),

But i want to use AbstractTableModel, but i am having two vectors,

how can i use this model,

please help me,

Thanks in advance
 
shansi raj
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its not very specific that you should use vector alone for JTable.Instead you could use Object[] too. In case if you are using arraylist,just do arrayList.toArray which returns you object[];

tableModel.addRow(arraylist.toArray()); will add a row with the data present in it.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!