aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes 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 "JTable" Watch "JTable" New topic
Author

JTable

ramesh kancherla
Ranch Hand

Joined: May 01, 2008
Posts: 124
How can I add checkBox into JTableCell

I am getting in a cell Javax.swing.JcheckBox[some information is here]

but cell not displaying checkBox view
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
search here, sun forums, google for keywords
JTable JCheckBox

you will find what you're after.
(the part you are probably missing is Boolean.class vs JCheckBox)
ramesh kancherla
Ranch Hand

Joined: May 01, 2008
Posts: 124
I have inserted in a table, in two columns icons, one column checkBox,
but icons inserted,checkbox not inserting

I passed object as JCheckBox instance
Guido Sautter
Ranch Hand

Joined: Dec 22, 2004
Posts: 142
Don't use the JCheckBox explicitly, just make the TableModel indicate Boolean.class as the class for the respective column. The TableCellRenderer will take care of the rest, i.e. display a checkbox automatically.
ramesh kancherla
Ranch Hand

Joined: May 01, 2008
Posts: 124
I passed the Boolean.class and I got checkBox view in cell

but when I click on checkBox , Box selection is not appeared on cell

I want show that selection value and read selection and unselection the checkBox values

can you please give mme advice
ramesh kancherla
Ranch Hand

Joined: May 01, 2008
Posts: 124
can any one help my problem
Guido Sautter
Ranch Hand

Joined: Dec 22, 2004
Posts: 142
In order to have the cell editable, the TableModel's isCellEditable() method has to return true for the column with the checkboxes.
A change to the checkbox will then call back the TableModel's setValueAt() method, so you can write back the change into your backing data structures.
Binod Suman
Greenhorn

Joined: May 07, 2008
Posts: 17
This is also a good and working small code for jcheckbox inside the jtable as cell.
Jtable with Jcheckbox.

Thanks,
Binod Suman
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JTable