This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes JTable prevent editing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "JTable prevent editing" Watch "JTable prevent editing" New topic
Author

JTable prevent editing

fadi mujahid
Greenhorn

Joined: Oct 14, 2002
Posts: 28
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

Joined: Apr 07, 2002
Posts: 194
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.


Mag
 
GeeCON Prague 2014
 
subject: JTable prevent editing