Here you can find the source of setAllEnabled(final ButtonGroup buttonGroup, final boolean enabled)
Parameter | Description |
---|---|
buttonGroup | The button group. |
enabled | Whether the button should be enabled. |
public static void setAllEnabled(final ButtonGroup buttonGroup, final boolean enabled)
//package com.java2s; //License from project: Creative Commons License import java.util.Collections; import javax.swing.AbstractButton; import javax.swing.ButtonGroup; public class Main { /**//ww w .j ava 2 s . c o m Enables (or disables) all the buttons in a button group. @param buttonGroup The button group. @param enabled Whether the button should be enabled. **/ public static void setAllEnabled(final ButtonGroup buttonGroup, final boolean enabled) { for (final AbstractButton button : Collections.list(buttonGroup.getElements())) { button.setEnabled(enabled); } } }