Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JCheckBox and JTable

843806Feb 10 2009 — edited Feb 11 2009
hi

I have a table where everycell in the table is a JCheckBox, but i want certain cells to be diabled during runtime.
so I am trying to reference to the JCheckBox of a specific cell so that i can make it disabled but cant work out how to do this. i have been trying to figure it out for two days with nothing!

bascailly i would like to do something like this

JCheckBox cb= new JCheckBox();
cb = (JCheckBox)table.getModel().getValueAt(2, 2);
cb.setEnabled(false);

(2,2) is just an example but in my program it will be different values everytime depending on conditions

please help I am getting really desperate now
thank you
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 11 2009
Added on Feb 10 2009
14 comments
437 views