• 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

How can i insert JRadioButton to Cell in JTable

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I need to insert JRadioButton to Cell in JTable.
I can insert JCheckBox, JComboBox, JTextFeild to JTable,
but DefaultCellEditor hasn't editor for JRadioButton.

Anybody have ideas?

I need help, immidiately!!!

HEEEEEEEEEEEEEEEEEEEEEEEEEEEELP!!!
 
Ranch Hand
Posts: 805
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I believe radio buttons don't work alone, they work in groups. Have you tried adding the radio buttons to a ButtonGroup, then adding the ButtonGroup to the cell using the add method?
 
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A ButtonGroup has no visual representation...

What do you wish to achieve by adding a radiobutton to the table?
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Alon Goldfeld:

I need to insert JRadioButton to Cell in JTable.
I can insert JCheckBox, JComboBox, JTextFeild to JTable,
but DefaultCellEditor hasn't editor for JRadioButton.



You have to use custom renderers and editors.

Quick solution:

Renderer


Editor
 
Geza Kovacs
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And register the renderer/editor in the table:

 
Alon Goldfeld
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank's, but how can i add this radiobuttons to the group.
Number of radiobuttons not constant.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic