Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

edit only one column in JTable  RSS feed

 
ramesh kancherla
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am displaying Icons and CheckBox in a jtable

I have one problem as icon cells are editing

so i called table.setEditable(false) method

then check boxes are not editing

i want icon cells are not editable and checkbox only editable in a table
 
Darryl Burke
Bartender
Posts: 5167
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

You can override TableModel#isCellEditable(int row, int col) to return true for the column of choice and false for all others.

If your columns cannot be reordered [JTable#getTableHeader().setReorderingAllowed(false)] you can use the method of the same name and signature in JTable.

Please read the API for these methods so that you understand the implication of reordering columns.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!