aspose file tools*
The moose likes Beginning Java and the fly likes reference problem within inner class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "reference problem within inner class" Watch "reference problem within inner class" New topic
Author

reference problem within inner class

miguel lisboa
Ranch Hand

Joined: Feb 08, 2004
Posts: 1281
inside my class Gui i've an anonymous inner class; from inside this inner class i need a reference to the outer class

how i did it: inside outer constructor,

then, inside inner, i used 'gui';

isnt there a better way?

TiA


java amateur
Ariel Ortiz
Ranch Hand

Joined: May 14, 2004
Posts: 121
If the name of the outer class is , you can use the following within the inner class:

...Ariel
miguel lisboa
Ranch Hand

Joined: Feb 08, 2004
Posts: 1281
i tested, it works and looks much cleaner

thanks for that
 
 
subject: reference problem within inner class