This week's book giveaway is in the Java in General forum.
We're giving away four copies of Helidon Revealed: A Practical Guide to Oracle’s Microservices Framework and have Michael Redlich on-line!
See this thread for details.
  • 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:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

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: 808
  • 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.
 
I can't renounce my name. It's on all my stationery! And hinted in this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic