Browse Source

[TikTakToeGame Class]: Button und Labels Definiert + in Main freigegeben

remotes/origin/TikTakToeGame
fdai7431 2 years ago
parent
commit
11c76fd5c7
  1. 2
      JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/GamelauncherMain.java
  2. 36
      JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/TikTakToeGame.java
  3. 0
      JavaGamelauncher/src/main/resources/de/hs_fulda/gruppenprojekt/JavaGamelauncher/media/GameLauncher.ico

2
JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/GamelauncherMain.java

@ -123,7 +123,7 @@ public class GamelauncherMain extends JFrame {//class
// TODO Auto-generated method stub
TikTakToeGame frameTikTakToe = new TikTakToeGame();
//frameTikTakToe.setVisible(true);
frameTikTakToe.setVisible(true);
}
});

36
JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/TikTakToeGame.java

@ -36,6 +36,20 @@ public class TikTakToeGame extends JFrame{
public String spieler2 = "Spieler 2 hat %d Punkte";
public int punkte1 = 0, punkte2 = 2;
JPanel panelHauptFeld = new JPanel();
JButton btnNewButton1 = new JButton("");
JButton btnNewButton2 = new JButton("");
JButton btnNewButton3 = new JButton("");
JButton btnNewButton4 = new JButton("");
JButton btnNewButton5 = new JButton("");
JButton btnNewButton6 = new JButton("");
JButton btnNewButton7 = new JButton("");
JButton btnNewButton8 = new JButton("");
JButton btnNewButton9 = new JButton("");
JButton btnNewButtonReset = new JButton("Reset Game");
JButton btnNewButtonClearField = new JButton("Feld Säubern");
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
@ -50,6 +64,26 @@ public class TikTakToeGame extends JFrame{
}
public TikTakToeGame() {}//end
public TikTakToeGame() {
setTitle("TikTakToe Game");
setIconImage(Toolkit.getDefaultToolkit().getImage(GamelauncherMain.class.getResource("/de/hs_fulda/gruppenprojekt/JavaGamelauncher/media/GameLauncher.ico")));
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 600, 600);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
setForeground(Color.GRAY);
setBackground(Color.DARK_GRAY);
contentPane.setForeground(Color.GRAY);
contentPane.setBackground(Color.DARK_GRAY);
contentPane.setLayout(null);
panelHauptFeld.setBackground(Color.GRAY);
panelHauptFeld.setBounds(10, 11, 400, 400);
contentPane.add(panelHauptFeld);
panelHauptFeld.setLayout(null);
}//end
}

0
JavaGamelauncher/src/main/resources/de/hs_fulda/gruppenprojekt/JavaGamelauncher/media/GameLauncher (1).ico → JavaGamelauncher/src/main/resources/de/hs_fulda/gruppenprojekt/JavaGamelauncher/media/GameLauncher.ico

Loading…
Cancel
Save