|
@ -11,24 +11,31 @@ import javax.swing.JLabel; |
|
|
import javax.swing.JPanel; |
|
|
import javax.swing.JPanel; |
|
|
|
|
|
|
|
|
public class gui { |
|
|
public class gui { |
|
|
JFrame jf; |
|
|
|
|
|
JButton StartBtn, CloseBtn; |
|
|
|
|
|
JPanel Panel; |
|
|
|
|
|
JLabel Label; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static JFrame jf; |
|
|
|
|
|
public static JButton StartBtn, CloseBtn; |
|
|
|
|
|
public static JPanel Panel; |
|
|
|
|
|
public static JLabel Label; |
|
|
public static int width = 800, height = 600; |
|
|
public static int width = 800, height = 600; |
|
|
|
|
|
|
|
|
public void create(){ |
|
|
|
|
|
|
|
|
public void StartMainMenu() { |
|
|
|
|
|
createFrame(); |
|
|
|
|
|
createButtons(); |
|
|
|
|
|
createPanel(); |
|
|
|
|
|
} |
|
|
|
|
|
public void createFrame(){ |
|
|
jf = new JFrame("Wer wird Millionr"); |
|
|
jf = new JFrame("Wer wird Millionr"); |
|
|
jf.setSize(width,height); |
|
|
jf.setSize(width,height); |
|
|
jf.setLocationRelativeTo(null); |
|
|
jf.setLocationRelativeTo(null); |
|
|
jf.setResizable(false); |
|
|
jf.setResizable(false); |
|
|
jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); |
|
|
jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void createButtons() { |
|
|
StartBtn = new JButton("Starte Spiel"); |
|
|
StartBtn = new JButton("Starte Spiel"); |
|
|
StartBtn.setSize(300,100); |
|
|
|
|
|
CloseBtn = new JButton("Schlieen"); |
|
|
CloseBtn = new JButton("Schlieen"); |
|
|
CloseBtn.setSize(300,100); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
public void createPanel() { |
|
|
Panel = new JPanel(); |
|
|
Panel = new JPanel(); |
|
|
Panel.setSize(width,height); |
|
|
Panel.setSize(width,height); |
|
|
Panel.setLayout(new GridBagLayout()); |
|
|
Panel.setLayout(new GridBagLayout()); |
|
@ -47,8 +54,7 @@ public class gui { |
|
|
jf.add(Panel); |
|
|
jf.add(Panel); |
|
|
jf.setVisible(true); |
|
|
jf.setVisible(true); |
|
|
Panel.setVisible(true); |
|
|
Panel.setVisible(true); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |