This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes editing a cell in a uneditable model of JTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "editing a cell in a uneditable model of JTable" Watch "editing a cell in a uneditable model of JTable" New topic
Author

editing a cell in a uneditable model of JTable

lavanya subramanian
Ranch Hand

Joined: Nov 03, 2000
Posts: 52
hi guys,
i have a JTable which is uneditable that is,i had overriden the isCellEditable method.but the question is ,if i press a button i should be able to insert a new row in that table.
is it possible.

thanks in advance
lavanya
Paul Stevens
Ranch Hand

Joined: May 17, 2001
Posts: 2823
Yes but you won't be able to change the values.
Jeff Wisard
Ranch Hand

Joined: Jan 07, 2002
Posts: 89
Actually, you can change any value at any time in the model programmatically by using the setValueAt() method. The isCellEditable() method only determines whether or not a cell value is changeable by a USER...that is, someone clicking or tabbing into the cell.
This is true for adding, updating, or removing row or cell data.


Jeff Wisard<br />Sun Certified Java Programmer (Java 2)<br />Sun Certified Web Component Developer
lavanya subramanian
Ranch Hand

Joined: Nov 03, 2000
Posts: 52
hi guys,
sorry for not explaining my problem clearly,
actually when i press the button,i want a empty cell in the JTable and i want only that cell to be editable,so that i can write a value there.
is it possible,if so how?.
thanks,
lavanya
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: editing a cell in a uneditable model of JTable