Java examples for java.awt:Component
disable Components inside java.awt.Container
//package com.java2s; import javax.swing.*; import java.awt.*; public class Main { public static void disableComponents(java.awt.Container c) { Component[] components = c.getComponents(); for (Component comp : components) { if (comp instanceof JScrollPane) continue; if (comp instanceof java.awt.Container) disableComponents((java.awt.Container) comp); comp.setEnabled(false);/*from w w w . j a v a2s .c o m*/ } } }