aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes putting multiple checkboxes on a JTable cell Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "putting multiple checkboxes on a JTable cell" Watch "putting multiple checkboxes on a JTable cell" New topic
Author

putting multiple checkboxes on a JTable cell

Jhedzkie Skies
Ranch Hand

Joined: Oct 28, 2009
Posts: 118
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

Joined: Nov 18, 2006
Posts: 174
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...


Censorship is the younger of two shameful sisters, the older one bears the name inquisition.
-- Johann Nepomuk Nestroy
Jhedzkie Skies
Ranch Hand

Joined: Oct 28, 2009
Posts: 118
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

Joined: Apr 24, 2010
Posts: 79
You can use clickCountToStart(1) which is a method of DefaultCellEditor Class
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
//super.fireEditingStopped();
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: putting multiple checkboxes on a JTable cell