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

Discussion in 'Java' started by Deshaies, Apr 20, 2004.

  1. Deshaies

    Deshaies Guest

    What function would I call to make the table cells uneditable?
    I'm using a JTable with DefaultTableModel.
    thanks, have a great day, JP
     
    Deshaies, Apr 20, 2004
    #1
    1. Advertising

  2. Deshaies

    Chris Smith Guest

    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
     
    Chris Smith, Apr 20, 2004
    #2
    1. Advertising

  3. Deshaies

    Tony Morris Guest

    > 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
     
    Tony Morris, Apr 20, 2004
    #3
  4. Deshaies

    Deshaies Guest

    "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
     
    Deshaies, Apr 20, 2004
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    558
  2. Mark Sizzler
    Replies:
    0
    Views:
    1,149
    Mark Sizzler
    Mar 6, 2005
  3. pat270881

    JTable - DefaultTableModel

    pat270881, Apr 11, 2005, in forum: Java
    Replies:
    0
    Views:
    3,463
    pat270881
    Apr 11, 2005
  4. Steve Kershaw

    GridView - how to make a cell uneditable?

    Steve Kershaw, Sep 19, 2007, in forum: ASP .Net
    Replies:
    4
    Views:
    868
    Steve Kershaw
    Sep 20, 2007
  5. Replies:
    0
    Views:
    328
Loading...

Share This Page