W jaki sposób mogę uzyskać dostęp do obejmowania zmiennych instancji klasy z anonimowej klasy?
Jak uzyskać dostępinstance variables
od wewnątrz metody anonimowej klasy?
class Tester extends JFrame {
private JButton button;
private JLabel label;
//..some more
public Tester() {
function(); // CALL FUNCTION
}
public void function() {
Runnable r = new Runnable() {
@Override
public void run() {
// How do I access button and label from here ?
}
};
new Thread(r).start();
}
}