• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

JTable column that can be both editable or non-editable

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello, i have an application that is stuck with some JTable issues. The first of which is i have a column in my JTable that i want to be editable IF a particular RadioButton is selected, and non-editable otherwise.

Here is a code snippet that i was able to work to get columns editable in my initialization:



Does anyone have any ideas as to how i can make case 0 return true IF a radio button (independent of the JTable but on the same page of my application) is not selected, but false if it is?

A thousand thank yous to the guru who solves my problem!!!
[ December 02, 2006: Message edited by: bill moody ]
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Extend your TableModel to turn on/off editing based on columns, then add a listener to the checkbox to call these methods...

 
bill moody
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
nathan thank you, this worked like a charm.

Well one point i would make for any future browsers of this was that attempting to integrate Nathan's code into my own, my isCellEditable method was returning false in both sides of the if condition until i realized this and adjusted my cells default values. I ended up just returning false for one side of the condition and returning true for the other side.

Once i did that, it worked like a charm!
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic