Radio Buttons

I created radio buttons and added an actionlistener to each one so when i select the button the image changes on the screen. But no matter what i do i can't seem to get the method to fire each time the button gets selected.

Does anybody know the format of the if-then statement for a radio button to get a method to fire? The methods fired with a drop down menu that looks like this....


I am not sure if it is possible to apply this statement to radiobuttons somehow?


  • The reason why your things is not working is that you might have not
    registered the component to the action listener. To register it you
    simply do radioButton.addActionListener(actionlistener). Every
    component has a listener, they might be diffrent, but you have to
    registere the components in order to get an action to fire.

    Hope that helps. :)


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


In this Discussion