Solved

Edit/UnEdit Dynamically in JTable

Posted on 2004-10-20
3
436 Views
Last Modified: 2008-01-09
Can I Edit /UnEdit cell(s) dynamically in JTable?
If yes, how?
0
Comment
Question by:j74
  • 2
3 Comments
 
LVL 37

Accepted Solution

by:
zzynx earned 250 total points
ID: 12367078
You mean make cells editable/non-editable on the fly?
Yes, you can.
Use your own TableModel in which you overwrite the isCellEditable() function:

public class MyTableModel extends DefaultTableModel {

     public boolean isCellEditable(int row, int column) {
         if ( whatever you like )  // e.g. if (column==2 && row < 3)
           return false; // uneditable
         return true; // editable
     }

}
0
 

Author Comment

by:j74
ID: 12369221
Thanks.
0
 
LVL 37

Expert Comment

by:zzynx
ID: 12369369
:°)
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
backtracking recursion  code 19 58
diffSum example 4 36
login jsp example 24 48
expectj telnet failing 5 36
For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question