title: Java Swing - How to disable a JPanel?
body: <p>I have several <code>JComponent</code>s on a <code>JPanel</code> and I want to disable all of those components when I press a Start button.</p>
  
  <p>At present, I am disabling all of the components explicitly by</p>
  
  <pre><code>component1.setEnabled(false);
  :
  :
  </code></pre>
  
  <p>But Is there anyway by which I can disable all of the components at once? I tried to disable the <code>JPanel</code> to which these components are added by</p>
  
  <pre><code>panel.setEnabled(false);
  </code></pre>
  
  <p>but it didn't work.</p>