This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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


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
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: inner class
 
It's not a secret anymore!