Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How can i insert JRadioButton to Cell in JTable

 
Alon Goldfeld
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • 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!!!
 
Jeff Bosch
Ranch Hand
Posts: 805
  • 0
  • Mark post as helpful
  • send pies
  • 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?
 
Sebastiaan Kortleven
Ranch Hand
Posts: 81
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A ButtonGroup has no visual representation...

What do you wish to achieve by adding a radiobutton to the table?
 
Geza Kovacs
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And register the renderer/editor in the table:

 
Alon Goldfeld
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank's, but how can i add this radiobuttons to the group.
Number of radiobuttons not constant.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic