Salve. Ho bisogno di creare 4 JRadioButton ma con delle immagini al posto del testo, ma il problema è che vengono visualizzate solamente le immagini e non i cerchietti che servono a selezionare la scelta... qualche aiuto?
codice:JRadioButton queen = new JRadioButton (new ImageIcon (getClass().getResource("queen" + color)), true); JRadioButton bishop = new JRadioButton(new ImageIcon (getClass().getResource("bishop" + color))); JRadioButton horse = new JRadioButton (new ImageIcon (getClass().getResource("horse" + color))); JRadioButton tower = new JRadioButton (new ImageIcon (getClass().getResource("tower" + color))); ButtonGroup group = new ButtonGroup(); group.add (queen); group.add (bishop); group.add (horse); group.add (tower); centerPanel.add (queen); centerPanel.add (bishop); centerPanel.add (horse); centerPanel.add (tower); dialog.add (centerPanel); dialog.setVisible (true);

Rispondi quotando