aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes JPanel Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JPanel Problem" Watch "JPanel Problem" New topic
Author

JPanel Problem

Garry Kalra
Ranch Hand

Joined: May 25, 2001
Posts: 111
I have a doubt.
I thought making a JPanel disabled would make all its components disabled, but i don't think this happens. Is there a way to desable all the components on the JPanel, or do i need to disable them individually.
Any help will be appreciated.
Regards
Gaurav Kalra
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

As far as I know, you have to disable each component. A JPanel is a Container. I think you can only disable Components.
You could use the getComponent() method which would throw all the components into an Object Array and then parse through them and disable them using a for loop. Maybe myComponent.setEnabled(false) for each component would be easier though.
Happy Coding


GenRocket - Experts at Building Test Data
Garry Kalra
Ranch Hand

Joined: May 25, 2001
Posts: 111
Thanks for the Information.
Garry Kalra
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JPanel Problem