List of usage examples for javax.swing JComponent getTreeLock
public final Object getTreeLock()
From source file:Main.java
public static void setEnabled(JComponent component, boolean t) { synchronized (component.getTreeLock()) { for (Component c : component.getComponents()) if (c instanceof JComponent) setEnabled((JComponent) c, t); }/*from www. j a v a2s . c o m*/ component.setEnabled(t); }