Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Disabling JPanel Components

960150Sep 5 2012 — edited Sep 5 2012
Dear ,

I have the following method that disable all the components in a JPanel;
It has a JLabel, JTextField, and a JButton.
When I call this method from the constructor of the parent class; It is only disabling the JLabel, and the JTextField.

If I extend this class from another class, and call this method; None of the components are disabled.
 
public void disablePanel()
    {
        myPanel.setEnabled(false);
        allCom = myPanel.getComponents();
        for (int i = 0 ; i < allCom.length; i++)
            allCom.setEnabled(false); 
}


Would any one, suggest what might the reason be?

Best Regards,
M. Tleis
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 3 2012
Added on Sep 5 2012
1 comment
291 views