java - Running a "this" Method inside actionPerformed - JButton? -


i have jbutton added actionperformed, , tried write "this" method , won't allow it. how can this? example of want do:

public void methodname(string results) {     this.results = results; }  button.addactionlistener(new actionlistener() {           public void actionperformed(actionevent event) {                     this.methodname(asdf);                                                  } 

because it's anonymous class, using this refer anonymous class instance, not overall class. around this, denote want reference outer class specifically:

something = new something() {      public void overridden() {         yourclass.this.methodname("test");     }  }; 

Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -