import java.awt.*;import javax.swing.*;public class Prueba extends JFrame{ JRadioButton rdnMacho; JRadioButton rdnHembra; ButtonGroup buttonGroup1; JButton btnLimpiar; JPanel jPanel1; public Prueba(){ initComponents(); } private void initComponents() { rdnMacho = new JRadioButton(); rdnHembra = new JRadioButton(); buttonGroup1 = new ButtonGroup(); btnLimpiar = new JButton(); jPanel1 = new JPanel(); JFrame f=new JFrame(); f.setSize(200,200); f.setLayout(null); jPanel1.setBounds(10, 10, 500,500); jPanel1.setLayout(null); buttonGroup1.add(rdnMacho); rdnMacho.setText("Macho"); rdnMacho.setBounds(10,50,80,20); jPanel1.add(rdnMacho); buttonGroup1.add(rdnHembra); rdnHembra.setText("Hembra"); rdnHembra.setBounds(10,80,80,20); jPanel1.add(rdnHembra); btnLimpiar.setMnemonic('L'); btnLimpiar.setText("Limpiar\n"); btnLimpiar.setBounds(100,60,80,30); jPanel1.add(btnLimpiar); f.add(jPanel1); f.setVisible(true); btnLimpiar.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Limpiar(evt); } }); } private void Limpiar(java.awt.event.ActionEvent evt) { rdnMacho.setSelected(false); } public static void main(String args[]){ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Prueba(); } }); }}