JRadioButton and ButtonGroup

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Bubbs
    New Member
    • Nov 2007
    • 17

    JRadioButton and ButtonGroup

    Hi,
    I have two radio buttons, b1 and b2. Now these two are added to a button group g1. I also have a JButton called submit. Now when I press "submit" I want to print on the console using system.out.prin tln, which of the radio buttons was clicked in the group?
    I assume the code will be written in the actionPerformed () for the submit button.

    Thanks
  • BigDaddyLH
    Recognized Expert Top Contributor
    • Dec 2007
    • 1216

    #2
    Post your best effort and ask a specific question about it. have you studied the section in Sun's Swing tutorial on all the buttons?

    Comment

    • Bubbs
      New Member
      • Nov 2007
      • 17

      #3
      I think I figured out how to make this work. Had to change some logic. Thanks for the link.

      Comment

      Working...