group Buttons - Java Swing

Java examples for Swing:JButton

Description

group Buttons

Demo Code


//package com.java2s;
import javax.swing.*;

public class Main {
    public static ButtonGroup groupButtons(AbstractButton... buttons) {
        ButtonGroup group = new ButtonGroup();
        for (AbstractButton button : buttons) {
            group.add(button);// w w  w  .  j  ava 2  s .c  om
        }
        return group;
    }
}

Related Tutorials