Creating Image Radio Buttons When using an image to represent the state of a radio button, it is necessary to provide it with two images - one that represents the ``selected'' state and another to represent the ``unselected'' state. The ``unselected'' image is assigned via the JRadioButton constructor while the ``selected'' image is assigned via the method setSelectedIcon(). ButtonGroup group = new ButtonGroup(); JRadioButton b1 = new JRadioButton("image1.gif"); b1.setSelectedIcon(new ImageIcon("images1s.gif")); b1.addActionListener(actionListener); group.add(b1); JRadioButton b2 = new JRadioButton("image1.gif"); b1.setSelectedIcon(new ImageIcon("images2s.gif")); b2.addActionListener(actionListener); group.add(b2); // Set one of the radio buttons on. group.setSelected(b1.getModel(), true);