I've class
BubblesFrame
which has inner class
startnewGame
:
public class startNewGame implements ActionListener{
public void actionPerformed(ActionEvent event){
remove(panel);
panel = new BubbleMainPanel();
add(panel);
validate();
panel.repaint();
}
}
in class
Menu
i'd like to add event handler
startNewGame
ActionListener listener = new BubblesFrame.startNewGame();
newGame.addActionListener(listener);
but it returns following error:
No enclosing instance of type BubblesFrame is accessible. Must qualify the allocation with an enclosing instance of type BubblesFrame (e.g. x.new A() where x is an instance of BubblesFrame)
what's wrong with my inner class?