File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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
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: 15286
    
    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 - A Test Data Generation Platform
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
 
Similar Threads
JPanel Problem
JScrollPane
Disabling a JPanel and all it's components
Resizing a JButton in GridLayout
Aligning component from Right to Left