Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8671471
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T18:57:31+00:00 2026-06-12T18:57:31+00:00

I have an JAVA project and want to make my JTable with a DefaultTableModel

  • 0

I have an JAVA project and want to make my JTable with a DefaultTableModel non-editable. I know a work-around to do this, called:

JTable table = new JTable(...){  
  public boolean isCellEditable(int row, int column){  
    return false;  
  }  
};  

Like said: i dont like this. This is not according the rules of my school training.

Is there any way to do this? Maybe is there a good way. I hope so!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T18:57:33+00:00Added an answer on June 12, 2026 at 6:57 pm

    You should not subclass the JTable itself, but the table model:

    DefaultTableModel myModel = new DefaultTableModel(...) {
        @Override
        public boolean isCellEditable(int row, int column) {
            return false;
        }
    }
    

    Or even better, don’t use a DefaultTableModel, and use an AbstractTableModel that directly gets the information in your business objects rather than copying all the information from the business objects to Vectors.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a java project deployed on the server. Now I want to make
I have made a java project and want to deliver it to a client
I have a Java project and I want to include a text file with
I have a project in Java. I want transform it to .NET-project. How to
I have 2 .properties files in my java project and I want to define
I have an Eclipse project where I want to keep my Java project built
I'm doing a Java project where I have to make a text similarity program.
I have a simple java project with this basic structure: IncludeMe src deploy siteSpecific
I have 3 Java projects with the same entities. I want to share entities
I have a few Java/Maven projects that I want to use in a Grails

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.