JTable - using DefaultTableModel - How do I make the table cells uneditable

D

Deshaies

What function would I call to make the table cells uneditable?
I'm using a JTable with DefaultTableModel.
thanks, have a great day, JP
 
C

Chris Smith

Deshaies said:
What function would I call to make the table cells uneditable?
I'm using a JTable with DefaultTableModel.

Doesn't look like you can. You could subclass DefaultTableModel and
override isCellEditable to give the right answer.

--
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 
T

Tony Morris

Doesn't look like you can. You could subclass DefaultTableModel and
override isCellEditable to give the right answer.

Yes, this is correct.
Or more specifically, provide an implementation of TableModel (subclass of
DefaultTableModel or not) that returns false from isCellEditable.

--
Tony Morris
(BInfTech, Cert 3 I.T.)
Software Engineer
(2003 VTR1000F)
Sun Certified Programmer for the Java 2 Platform (1.4)
Sun Certified Developer for the Java 2 Platform
 
D

Deshaies

Tony Morris said:
Yes, this is correct.
Or more specifically, provide an implementation of TableModel (subclass of
DefaultTableModel or not) that returns false from isCellEditable

Thanks for your help everyone.
JP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,480
Members
44,900
Latest member
Nell636132

Latest Threads

Top