• Post Reply Bookmark Topic Watch Topic
  • New Topic

the icon of jcheckBox dosnt appear in jTableCell

 
mohamed abdo
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
im using
it works but the icon of the checkbox dosent appear till you click on the cell
 
Rob Spoor
Sheriff
Posts: 20819
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's because you need a TableCellRenderer for displaying cells when they are not edited.

However, you can make your JTable use a check box for both rendering and editing a lot easier: make your TableModel return Boolean.class in its getColumnClass method for that column. JTable uses that return value to determine a global renderer / editor for cells, and for Boolean that is a check box.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!