Is there any way to initialize anonymous inner class in Java?
For example:
new AbstractAction() { actionPerformed(ActionEvent event) { ...
It's not quite clear what you mean, but you can use an initializer block to execute code at construction time:
new AbstractAction() { { // This code is called on construction } @Override public void actionPerformed(ActionEvent event) { ... } }