Java tutorial
//package com.java2s; import java.awt.Component; public class Main { public static void setEnabled(final boolean isEnabled, final Component... components) { for (final Component component : components) { component.setEnabled(isEnabled); } } }