Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Button to JTable.  RSS feed

 
Bob Green
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any one knows how to add a JButton to a table cell?

This is the getValueAt() method:
public Object getValueAt(int row, int col) {
if (col == 0)
return "1";
else if (col == 1)
return new JButton("details");
}
It does not work!!!

Thanks in advance!
 
Rachel Swailes
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's all about TableCellRenderers. Have a look at the tutorial on the Sun website.

Cheers,
Rachel
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!