954,523 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Table Model - Multiple check boxes in same row

I'm trying to create my own JTable, with every row containing 5 check boxes
meaning that I have 5 columns and I want them all to have check boxes
When I try that the table goes blank and nothing appears at all, so I can only put 1 per row.
1 2 3 4 5
----------------------------------------------------
I1 | CB | CB | CB | CB | CB
I2 | CB | CB | CB | CB | CB
I3 | CB | CB | CB | CB | CB
I4 | CB | CB | CB | CB | CB

private Object[][] data = {
	    {"I1",new Boolean (false) ,
	     new Boolean (true), new Boolean (true), new Boolean (true)}
ayas
Newbie Poster
3 posts since Aug 2011
Reputation Points: 10
Solved Threads: 0
 
private Object[][] data = {
{"I1",new Boolean (false) , new Boolean (true), new Boolean (true), new Boolean (true), {"I1",new Boolean (false) , new Boolean (true), new Boolean (true), new Boolean (true),{"I1",new Boolean (false) , new Boolean (true), new Boolean (true), new Boolean (true),{"I1",new Boolean (false) , new Boolean (true), new Boolean (true), new Boolean (true),{"I1",new Boolean (false) , new Boolean (true), new Boolean (true), new Boolean (true),}
new Boolean (false)


is useless definifion if is correctly set Column#Class, then is sufficient declare only

(false)
mKorbel
Veteran Poster
1,141 posts since Feb 2011
Reputation Points: 480
Solved Threads: 224
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: