diff --git a/src/main/java/views/MainFrame.java b/src/main/java/views/MainFrame.java index cc1077e..fdd34fa 100644 --- a/src/main/java/views/MainFrame.java +++ b/src/main/java/views/MainFrame.java @@ -5,6 +5,8 @@ import javax.swing.*; import java.awt.*; +import java.awt.event.WindowEvent; +import java.awt.event.WindowListener; public class MainFrame extends JFrame { StepScheduler stepScheduler; @@ -18,5 +20,41 @@ mainPanel.setVisible(true); this.add(mainPanel, BorderLayout.CENTER); this.pack(); + this.addWindowListener(new WindowListener() { + @Override + public void windowOpened(WindowEvent e) { + mainPanel.playerBehave(stepScheduler); + } + + @Override + public void windowClosing(WindowEvent e) { + + } + + @Override + public void windowClosed(WindowEvent e) { + + } + + @Override + public void windowIconified(WindowEvent e) { + + } + + @Override + public void windowDeiconified(WindowEvent e) { + + } + + @Override + public void windowActivated(WindowEvent e) { + + } + + @Override + public void windowDeactivated(WindowEvent e) { + + } + }); } }