aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes inner class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "inner class " Watch "inner class " New topic
Author

inner class

vivi santa
Greenhorn

Joined: Feb 02, 2001
Posts: 26
I've got an inner class question.
I am working on a GUI user interface using AWT with some buttons and textfield. When I do some action performed in class c or class d, how can I invoked x and change its value?
class A extends class B {
Label x
A(){
....
}
class C extends Panel implements ActionListener {
.....
.....
}
class D extends Panel implements ActionListener {
.....
.....
public void actionPerformed{

(access x in here)
}
}

}
Thanks in advance



vineetsab
Greenhorn

Joined: Jul 03, 2001
Posts: 2
class member variables can be accessed inside inner classes. x = new Label() should work in classes c and d
Jane Griscti
Ranch Hand

Joined: Aug 30, 2000
Posts: 3141
Hi vineetsab,
Please read the JavaRanch Name Policy and re-register using a name that complies with the rules.
Thanks for your cooperation.
------------------
Jane Griscti
Sun Certified Programmer for the Java� 2 Platform


Jane Griscti
SCJP, Co-author Mike Meyers' Java 2 Certification Passport
 
jQuery in Action, 2nd edition
 
subject: inner class