This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JTable prevent editing

 
fadi mujahid
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello
When I double click on a cell in my table, I can edit the data of that cell. Is there a way to prevent this?
Thanks
 
Mag Hoehme
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
yes, you can prevent the editing.
The TableModel interface declares a method "public boolean isCellEditable (int row, int col)". You can implement this method, and let it always return false:

Hope this helps.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic