JCheckBox en java!

Esta vez hablaremos de los JCheckBox, un pequeño ejemplo para guiarlos, el código lo colocare en la parte de abajo después del vídeo, espero que les funcione gente, cualquier duda comenten.


clase VentanaCheck
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JFrame;

public class VentanaCheck extends JFrame{
 
 private JCheckBox cb1, cb2;
 private JButton btn_Verificar;
 
 public VentanaCheck() {
  this.setTitle("Aprendiendo check Box");
  this.setSize(300,300);
  this.setLocation(450,50);
  this.setVisible(true);
  this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 
  
  componentes();
 }
 public void componentes(){
  this.setLayout(null);
  
  add(cb1 = new JCheckBox("mujer",false));
  cb1.setBounds(10,10,100,30);
  
  add(cb2 = new JCheckBox("hombre",false));
  cb2.setBounds(10,50,100,30);
  
  add(btn_Verificar = new JButton("Verificar"));
  btn_Verificar.setBounds(10,100,120,30);
  
  btn_Verificar.addActionListener(new ActionListener() {

   public void actionPerformed(ActionEvent e) {
    // TODO Auto-generated method stub
      if(cb1.isSelected()){
         System.out.println("Se selecciono Mujer");
      }else{
         if(cb2.isSelected()){
            System.out.println("Se selecciono Hombre");
         }else{
            System.out.println("No hay nada seleccionado!");
         }
      }    
    }
  });  
 }
}
Clase Main
public class Main {

 public static void main(String[] args) {
  // TODO Auto-generated method stub
  VentanaCheck vc = new VentanaCheck();
 }
}