Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

reference problem within inner class

 
miguel lisboa
Ranch Hand
Posts: 1281
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ariel Ortiz
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the name of the outer class is , you can use the following within the inner class:

...Ariel
 
miguel lisboa
Ranch Hand
Posts: 1281
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i tested, it works and looks much cleaner

thanks for that
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic