So I have two classes: "Simulator" and "SimulationWindow". Simulator holds all methods and functions the Simulator uses and also defines an instance of SimulationWindow.
SimulationWindow makes the GUI. In this GUI I have 4 JButtons. These buttons should call methods implemented in Simulator. But how can I connect the buttons with the listener?
button1.addActionListener( ??? );
I struggle because my program has a main class to start the Simulator:
Simulator sim1 = new Simulator();
So I have this object Simulator and cannot create another one in SimulationWindow?