Forums Register Login

inner class

+Pie Number of slices to send: Send
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



+Pie Number of slices to send: Send
class member variables can be accessed inside inner classes. x = new Label() should work in classes c and d
+Pie Number of slices to send: Send
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
Morning came much too soon and it brought along a friend named Margarita Hangover, and a tiny ad.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 546 times.
Similar Threads
declaration of an inner class:
INNER CLASS
Confused about Dan's exam...
Question related to instanceof operator from Khalid Book
Inner class/anonymous
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 00:16:39.