Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > JTable - using DefaultTableModel - How do I make the table cells uneditable

Reply
Thread Tools

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

 
 
Deshaies
Guest
Posts: n/a
 
      04-20-2004
What function would I call to make the table cells uneditable?
I'm using a JTable with DefaultTableModel.
thanks, have a great day, JP
 
Reply With Quote
 
 
 
 
Chris Smith
Guest
Posts: n/a
 
      04-20-2004
Deshaies wrote:
> 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
 
Reply With Quote
 
 
 
 
Tony Morris
Guest
Posts: n/a
 
      04-20-2004
> 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



 
Reply With Quote
 
Deshaies
Guest
Posts: n/a
 
      04-20-2004
"Tony Morris" <> wrote in message news:<c62g0s$m5c$>...
> > 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


Thanks for your help everyone.
JP
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to implement an undeditable JTable without overriding class DefaultTableModel clusardi2k@aol.com Java 0 09-12-2012 04:25 PM
GridView - how to make a cell uneditable? Steve Kershaw ASP .Net 4 09-20-2007 08:23 PM
Writing to Cells in the Detailsview Insertmode makes cells uneditable. SixStringSlaya@gmail.com ASP .Net 0 02-28-2006 10:23 PM
JTable - DefaultTableModel pat270881 Java 0 04-11-2005 10:33 AM
DefaultTableModel() is a crap / How to hide a Table column? Mark Sizzler Java 0 03-06-2005 03:51 PM



Advertisments