public class GameMenu extends JPanel{
private final Core core;
private final JButton loadGame;
private final JButton saveGame;
private final JButton exit;
private final JButton newGame;
public GameMenu(Core core){
setPreferredSize(new Dimension(600, 600));
setBackground(Color.BLACK);
this.core = core;
newGame = new JButton(newGameAction);
loadGame = new JButton(loadGameAction);
saveGame = new JButton(saveGameAction);
exit = new JButton(exitGameAction);
add(newGame);
add(loadGame);
add(saveGame);
add(exit);
}
private Action newGameAction = new AbstractAction("New Game") {
@Override
public void actionPerformed(ActionEvent e) {
this.core.
}
};
HI, i want to call a method of core instead of call a method of this class which would call the proper method of core The problem is that i dont know how to reach the core field cos its cannot find thx