Java Swing - How to disable a JPanel?

Posted by Yatendra Goel on Stack Overflow See other posts from Stack Overflow or by Yatendra Goel
Published on 2010-04-26T12:34:23Z Indexed on 2010/04/26 12:43 UTC
Read the original article Hit count: 217

Filed under:
|
|

I have several JComponents on a JPanel and I want to disable all of those components when I press a Start button.

At present, I am disabling all of the components explicitly by

component1.setEnabled(false);
:
:

But Is there anyway by which I can disable all of the components at once? I tried to disable the JPanel to which these components are added by

panel.setEnabled(false);

but it didn't work.

© Stack Overflow or respective owner

Related posts about java

Related posts about swing