This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes JPanel Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply 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
Ranch Hand

Joined: Jul 11, 2001
Posts: 15230

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
Garry Kalra
Ranch Hand

Joined: May 25, 2001
Posts: 111
Thanks for the Information.
Garry Kalra
 
 
subject: JPanel Problem
 
Similar Threads
JPanel Problem
Resizing a JButton in GridLayout
JScrollPane
Aligning component from Right to Left
Disabling a JPanel and all it's components