how to disable all the components in a frame
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   devaki_perumal
Posted On:   Friday, August 17, 2001 12:06 AM

i have a frame.I want to disable all the components like menu buttons
this.setEnable(false); doesn't disable menu and buttons
how to do this

help me

Re: how to disable all the components in a frame

Posted By:   Naveed_Azhar  
Posted On:   Friday, August 17, 2001 03:21 AM

Hi there

For menu components do something like this. It will work for you.

Component[] comps = fileMenu.getMenuComponents();
for ( int i = 0; i < comps.length ; i++ ) {
comps[i].setEnabled(false);
}

and for ordinary components you can do

Component[] comps = this.getContentPane().getComponents();
for ( int i = 0; i < comps.length ; i++ ) {
comps[i].setEnabled(false);
}



naveed@hotmail.com
About | Sitemap | Contact