• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to get the contents of the selected JTable row?

 
Bruce Jin
Ranch Hand
Posts: 672
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know I can use JTable.getSelectedRow() to get the index of the selected row. Can I get the contents of the selected JTable row directly?
Assuming I am using AbstractTableModle.
Thanks
Bruce
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bruce,
You can only get one cell value at a time.
getValueAt( row, col );
using the row you already have and making use of:
getColumnCount()
method should work for you.
Regards,
Manfred.
 
Bruce Jin
Ranch Hand
Posts: 672
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Manfred!
Bruce
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!