This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

trouble with JTable  RSS feed

 
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.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!