Java ButtonGroup create from button array

Description

Java ButtonGroup create from button array

import javax.swing.AbstractButton;
import javax.swing.ButtonGroup;

public class Main {
  public static ButtonGroup groupButtons(AbstractButton... buttons) {
    ButtonGroup group = new ButtonGroup();
    for (AbstractButton button : buttons) {
      group.add(button);//from www .  ja  v  a 2 s. co m
    }
    return group;
  }
}



PreviousNext

Related