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
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: reference problem within inner class
 
Similar Threads
Inner Classes
Inner Class
Cannot this an outer class instance from an inner class?
How to reference outer class from within inner class
Generics: cannot make a static reference to the non-static type