Java JComponent Properties setComponentEnabled(JComponent component, Boolean isEnabled)

Here you can find the source of setComponentEnabled(JComponent component, Boolean isEnabled)

Description

set Component Enabled

License

Open Source License

Declaration

public static void setComponentEnabled(JComponent component, Boolean isEnabled) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import javax.swing.*;

import java.awt.*;

public class Main {
    public static void setComponentEnabled(JComponent component, Boolean isEnabled) {
        if (component == null)
            return;
        component.setEnabled(isEnabled);
        Component[] components = component.getComponents();

        for (Component component1 : components) {
            if (component1 instanceof JComponent) {
                setComponentEnabled((JComponent) component1, isEnabled);
            }//w w w  . j  ava  2  s .c  om
        }
    }
}

Related

  1. isVisible(JComponent comp)
  2. isVisibleOnScreen(final JComponent component)
  3. registerComponent(JComponent c)
  4. registerDataFlavors(JComponent component, DataFlavor... dataFlavors)
  5. resetDisplayComponent(JComponent mainComp, JComponent nonDispComp, JComponent newDispComp)
  6. setDirty(JComponent comp, boolean isDirty)
  7. setGlassPane(JComponent comp, Component glass, boolean visible)
  8. setLegendVisible(JComponent chartUI, boolean visible)
  9. setLightweightDispatcher(JComponent component)