diff --git a/src/MainFrame.java b/src/MainFrame.java index 2ac5fdb..3b21413 100644 --- a/src/MainFrame.java +++ b/src/MainFrame.java @@ -48,13 +48,14 @@ public class MainFrame extends JFrame { startMultiplayerGame multiplayerGame = new startMultiplayerGame(this); coinToss coinToss = new coinToss(this); Verbinden verbinden = new Verbinden(this); - + WinLooseScreen winLooseScreen = new WinLooseScreen(this,true); // Panels hinzufügen mainPanel.add(mainMenuView, "MainMenu"); mainPanel.add(localGame, "LocalGame"); mainPanel.add(multiplayerGame, "MultiplayerGame"); mainPanel.add(coinToss, "coinToss"); mainPanel.add(verbinden, "Verbinden"); + mainPanel.add(winLooseScreen, "WinLooseScreen"); // Hauptpanel in JFrame hinzufügen add(mainPanel); diff --git a/src/WinLooseScreen.java b/src/WinLooseScreen.java new file mode 100644 index 0000000..f347c22 --- /dev/null +++ b/src/WinLooseScreen.java @@ -0,0 +1,26 @@ +import java.awt.*; +import javax.swing.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.io.IOException; +import java.net.InetSocketAddress; + +public class WinLooseScreen extends JPanel { + JLabel winLabel = new JLabel("Du hast Gewonnen!"); + JLabel looseLabel = new JLabel("Du hast Verloren!"); + + Font robotoFont = new Font("Roboto", Font.BOLD, 45); + + public WinLooseScreen(MainFrame frame,boolean wl) { + setLayout(null); + buildPanel(frame,wl); + } + + public void buildPanel(MainFrame frame,boolean wl) { + if (wl) { + add(winLabel); + }else{ + add(looseLabel); + } + } +}