• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

JTable  RSS feed

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