From 11c76fd5c737daf7c595e53fe2136a7d2e7a33f4 Mon Sep 17 00:00:00 2001 From: fdai7431 Date: Wed, 18 Jan 2023 10:37:14 +0100 Subject: [PATCH] [TikTakToeGame Class]: Button und Labels Definiert + in Main freigegeben --- .../JavaGamelauncher/GamelauncherMain.java | 2 +- .../JavaGamelauncher/TikTakToeGame.java | 36 +++++++++++++++++- ...{GameLauncher (1).ico => GameLauncher.ico} | Bin 3 files changed, 36 insertions(+), 2 deletions(-) rename JavaGamelauncher/src/main/resources/de/hs_fulda/gruppenprojekt/JavaGamelauncher/media/{GameLauncher (1).ico => GameLauncher.ico} (100%) diff --git a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/GamelauncherMain.java b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/GamelauncherMain.java index 9cd2b26..da6ef00 100644 --- a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/GamelauncherMain.java +++ b/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); } }); diff --git a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/TikTakToeGame.java b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/TikTakToeGame.java index e9ad1ba..a825ccc 100644 --- a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/TikTakToeGame.java +++ b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/TikTakToeGame.java @@ -35,6 +35,20 @@ public class TikTakToeGame extends JFrame{ public String spieler1 = "Spieler 1 hat %d Punkte"; 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() { @@ -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 } diff --git a/JavaGamelauncher/src/main/resources/de/hs_fulda/gruppenprojekt/JavaGamelauncher/media/GameLauncher (1).ico b/JavaGamelauncher/src/main/resources/de/hs_fulda/gruppenprojekt/JavaGamelauncher/media/GameLauncher.ico similarity index 100% rename from JavaGamelauncher/src/main/resources/de/hs_fulda/gruppenprojekt/JavaGamelauncher/media/GameLauncher (1).ico rename to JavaGamelauncher/src/main/resources/de/hs_fulda/gruppenprojekt/JavaGamelauncher/media/GameLauncher.ico