Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JTable configuration

 
Hanna Habashy
Ranch Hand
Posts: 532
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi:
How can I make a JTable non editable and its rows selectable at the same time.
I want to make the user to be able to highlight a row, but not allowed to edit the table.
thanks
 
Jose Botella
Ranch Hand
Posts: 2120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Searching the API I find out that there is not a proper setEditable method, thus we need to override TableModel.isCellEditable(row, column) to return false for every cell.

 
I'm so happy! And I wish to make this tiny ad happy too:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!