Win a copy of Rust Web Development this week in the Other Languages forum!
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

putting multiple checkboxes on a JTable cell

 
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 174
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can use clickCountToStart(1) which is a method of DefaultCellEditor Class
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
//super.fireEditingStopped();
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic