File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

inner class

vivi santa

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
class C extends Panel implements ActionListener {
class D extends Panel implements ActionListener {
public void actionPerformed{

(access x in here)

Thanks in advance


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 agree. Here's the link:
subject: inner class
It's not a secret anymore!