Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

import javax.swing.DefaultButtonModel;
import javax.swing.JRadioButton;

public class Main {
    /**
     * Determines if radio button is selected.
     * 
     * @param radioButton
     * @return
     */
    public static boolean isRadioButtonSelected(JRadioButton radioButton) {

        DefaultButtonModel model = (DefaultButtonModel) radioButton.getModel();
        return model.getGroup().isSelected(model);
    }
}