Is it ok to set actions like in the code sample below? Are there any possible garbage collection problems that might be caused by this? And if not what would be the best way to do this?
btnAwesomeButton=new JButton(new AbstractAction("Awesome Button") {
@Override
public void actionPerformed(ActionEvent arg0) {
//Do stuff here
//Refer to the components on parent windows through ParentWindowClass.this.componentName
}
});