table = new javax.swing.JTable(){
public boolean isCellEditable(int rowIndex, int colIndex) {
return false; //Disallow the editing of any cell
}
};
where table is the name of your JTable.
For NetBeans users:
1. select the table GUI, right click, select Customize Code
2. Your code should look like this:
35 comments:
Thank you! It really works. Although it's hard to find, your solution is great for NetBeans users.
You're welcome :)
many thanks
working ...
thanks, it works for me
thanks, much better than reinventing the wheel :)
Hi, thank you for your article...
Thank you so much
so helpfullness :D
Elakiri samaga nala jalaya
it really works thanks
Sadiq
hyderabad
India
Excelent!! It works perfect! Thank you!
thank you!
The other option is to override isCellEditable in your TableModel:
@Override public boolean isCellEditable(int rowIndex, int columnIndex)
oh wow, you are A SAVIOR!
Thank you very very much...
This helped me a lot, thanks.
Thanks alot
I have some problem and 've just solved it. thank u!
Hello miss... i am pradeep ..i m novice in swing ...can u please explain Where i have to call the method isCellEditable()..... bcoz i used it in my program but its not working......
Thank you , buddy Your solution works !!
Thank * 100 you!
its really work thanxs alot...
thanksss
Hie Guys
In netbeans the easiest way to do it is select table properties and go to model and click the ellipses. A dialog window will show up. Just uncheck editable on Table settings and that it. You are done good luck.
Thanks much helpful than StackOverflow :)
Thanks much, from Nicaragua
THANK YOU VERY MUCH!!! :D
your posting really help me alot, thanks
greeting from Indonesia :)
Hello "JET"! This post save me. Thank you very much.
cam on nhieu love u
Thank you very much! I was really trying very hard for this.
Heheheh 1000000000% helpful. Thanks. KEEP IT UP!!!
Your talent is hard to find.
Thanks a lot. It perfectly works.
Gracias,amigo.
Thanks so much :)
Great. Thank you so much
Post a Comment