Yes, because in an anonymous inner class, you can access it as follows:
final class FooButton extends JButton { Foo() { super("Foo"); addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { FooButton button = FooButton.this;
The code for an anonymous ActionListener could, in principle, be called and used by FooButton before the FooButton is fully initialized.
source share