Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

putting multiple checkboxes on a JTable cell

 
Aron Jhed Amiscosa
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi there.

i would like to ask for some help regarding on this.

i have read a topic not long ago with the same matter but is about ImageIcon.

i tried to create my own but im getting not my desired output...



this code shows the boxes, but requires to double click on the checkbox before getting selected.

can somebody correct my code as single clicked? please?

thanks in advance.
 
Peter Taucher
Ranch Hand
Posts: 174
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think there might be some code missing here ... because I don't see no tables. Nonetheless I think there might be a problem with the focus, so that the first mouse event on the table set's the focus (to the cell) and is consumed somehow. I think you might need to override the method 'isCellEditable' in your Editor...
 
Aron Jhed Amiscosa
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Peter Taucher wrote:I think there might be some code missing here ... because I don't see no tables.


these are just classes.




Jhedzkie Skies wrote:
this code shows the boxes, but requires to double click on the checkbox before getting selected.

can somebody correct my code as single clicked? please?


Peter Taucher wrote:
Nonetheless I think there might be a problem with the focus, so that the first mouse event on the table set's the focus (to the cell) and is consumed somehow. I think you might need to override the method 'isCellEditable' in your Editor...


ill try to do what you said. thanks for the tip.
can you give me some snippets? im completely puzzled about this.
 
Rohit Kedia
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use clickCountToStart(1) which is a method of DefaultCellEditor Class
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
//super.fireEditingStopped();
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic