• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JTable with RadioButton Headers

 
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've seen examples of JTables with push button header examples. They work well enough but I could really use a RadioButton header.

Has anyone ever don't anything like that?

I'm including some code that I use for a push button header. I've tried to adapt a RadioButton header from this code but I have had much luck.




 
Ranch Hand
Posts: 820
IntelliJ IDE VI Editor Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I got radio buttons to show up in your table headers by having it extend JRadioButton instead of JButton:
You will need change the listener to work better with radio buttons.
 
jefff willis
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Tim,

Thanks for the help.

My problem with the RadioButton example is that I can't seem to get them to "group."

When I press Column 1 for example, I want the other columns to be un-selected.

I'm in the process of implementing that in my mouse listener, but I was kind of hoping that the SWING components would do this for me.
 
reply
    Bookmark Topic Watch Topic
  • New Topic