public class Test {
private void setupListener() {
JButton button = new JButton("Hello");
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.out.println("Bla bla " + e);
}
});
}
}
Trying to extract the System.out-line, naming it "actionPerformed", too,
results in
public class Test {
private void setupListener() {
JButton button = new JButton("Hello");
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
actionPerformed(e);
}
});
}
private void actionPerformed(ActionEvent e) {
System.out.println("Bla bla " + e);
}
}
This causes an StackOverflowError. The "Test.this" is missing!
BTW: Why does IDEA don't suggest the "this", when entering "Test." in the
inner class?
Best regards
Thomas Singer
_______________________________________________
Eap-list mailing list
[EMAIL PROTECTED]
http://www.intellij.com/mailman/listinfo/eap-list