File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes JCheckBox and JTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JCheckBox and JTable" Watch "JCheckBox and JTable" New topic

JCheckBox and JTable

Nadin Jovan

Joined: Aug 12, 2003
Posts: 7
here is my problem.
I have a JPanel which contains a JCheckBox which is selected by default.
The panel also contains a JTable. Each cell in the table represents a check box too. By default all cells in the table are selected. I need to deselect the JCheckBox if the user deselects one cell in the table. How can I set up an event listener that would do that?
Nathan Pruett

Joined: Oct 18, 2000
Posts: 4121

I would actually do this through the TableModel...

Here's an example :
The TableModel -

The panel that pulls it together -

And a demonstration -

Write once, run anywhere, because there's nowhere to hide! - /. A.C.
I agree. Here's the link:
subject: JCheckBox and JTable
It's not a secret anymore!