|
@ -10,19 +10,21 @@ import javax.swing.JFrame; |
|
|
import javax.swing.JLabel; |
|
|
import javax.swing.JLabel; |
|
|
import javax.swing.JPanel; |
|
|
import javax.swing.JPanel; |
|
|
|
|
|
|
|
|
public class gui { |
|
|
|
|
|
|
|
|
public class gui implements GuiInterface { |
|
|
public static JFrame Frame; |
|
|
public static JFrame Frame; |
|
|
public static JButton StartBtn, CloseBtn; |
|
|
public static JButton StartBtn, CloseBtn; |
|
|
public static JPanel Panel; |
|
|
public static JPanel Panel; |
|
|
public static JLabel Label; |
|
|
public static JLabel Label; |
|
|
public static int width = 800, height = 600; |
|
|
public static int width = 800, height = 600; |
|
|
|
|
|
|
|
|
public void StartMainMenu() { |
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public void StartMainMenu() { |
|
|
createFrame(); |
|
|
createFrame(); |
|
|
createButtons(); |
|
|
createButtons(); |
|
|
createPanel(); |
|
|
createPanel(); |
|
|
} |
|
|
} |
|
|
public void createFrame(){ |
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public void createFrame(){ |
|
|
Frame = new JFrame("MiniGames"); |
|
|
Frame = new JFrame("MiniGames"); |
|
|
Frame.setSize(width,height); |
|
|
Frame.setSize(width,height); |
|
|
Frame.setLocationRelativeTo(null); |
|
|
Frame.setLocationRelativeTo(null); |
|
@ -30,6 +32,7 @@ public class gui { |
|
|
Frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); |
|
|
Frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
public void createButtons() { |
|
|
public void createButtons() { |
|
|
StartBtn = new JButton("Starte Spiel"); |
|
|
StartBtn = new JButton("Starte Spiel"); |
|
|
StartBtn.addActionListener(new StartGameGui()); |
|
|
StartBtn.addActionListener(new StartGameGui()); |
|
@ -38,6 +41,7 @@ public class gui { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
@Override |
|
|
public void createPanel() { |
|
|
public void createPanel() { |
|
|
Panel = new JPanel(); |
|
|
Panel = new JPanel(); |
|
|
Panel.setSize(width,height); |
|
|
Panel.setSize(width,height); |
|
|