Java tutorial
//package com.java2s; import java.util.Enumeration; import javax.swing.AbstractButton; import javax.swing.ButtonGroup; public class Main { public static AbstractButton getSelectedButton(ButtonGroup group) { Enumeration<AbstractButton> buttons = group.getElements(); while (buttons.hasMoreElements()) { AbstractButton b = buttons.nextElement(); if (b.isSelected()) { return b; } } return null; } }