• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

JTable Disable Entire Column

 
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can we disable an entire column in a JTable?
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
isCellEditable(...)
 
meera rao
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Isn't this method used to find out if a particular cell is editable or not?
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> Isn't this method used to find out if a particular cell is editable or not?

 
meera rao
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot for sharing the code with me. I'll try to figure out how to use it in my case.
 
Ranch Hand
Posts: 430
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there how to do it after instanciation?
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can create a class field
int col = -1;

then have the code


then select the column (col) later on (runtime etc)
 
Leandro Coutinho
Ranch Hand
Posts: 430
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for your reply.

what I trying to say is it:

JTable jt = new JTable();

...

then I add the restriction.
 
Leandro Coutinho
Ranch Hand
Posts: 430
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
don't need to worry!

it was because I'm using Netbeans and he doens't permit edit the text. But I openned with other text editor and added your solution.


thanks a lot
 
You save more money with a clothesline than dozens of light bulb purchases. Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic