This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JTable

 
ramesh kancherla
Ranch Hand
Posts: 124
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4632
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 124
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 142
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 124
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 124
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can any one help my problem
 
Guido Sautter
Ranch Hand
Posts: 142
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic