Mithun Chennuru wrote:Sam,
what SSCCE do you want from me? I posted the code that I have. I am unable to understand when you say SSCCE. Also, I am trying to write a setValueAt() method as follows:
but, getDataVector() is undefined for AbstractTableModel. How do i work around it? And as you said, how do I add Boolean value to my CellInfo object?/ Please help.
OK first an SCCE is a self-contained compilable (it works!) example.
You should post such a thing so that people can copy and paste it into their own editors and RUN it. This helps people debug your code and find the problem. It should NOT be big- specifically, it should not be *the code you are actually working on* in most cases since that's usually BIG and people's eyes just glaze over . What you want to do is try to distill the problem you're having into an SCCEE. That means writing a small program for no other purpose than 1) demonstrating the problem and 2) requesting help. It is (can be) some work, but people want you to do it. It's a norm.
Second , If you create your TableModel so that it is composed of Boolean type things, the JTable will, without further work required on your part display the table data as checkboxes like you're trying to do.
The TableModel is abstract but you can use DefaultTableModel which is not abstract and will accept Boolean type things as elements and give you a lot of what you're looking for. Definitely read the Swing tutorial on Oracle's site and reply back when you have a specific question. The smaller and more specific the question, the faster you'll get answers to your questions. Ask small specific questions , as many as you want. That's the best way to make progress against your problems..looking forward to working with you!
HTH!