WinLoose grob erstellt
This commit is contained in:
parent
d8804d5369
commit
0935c3bcb7
|
@ -48,13 +48,14 @@ public class MainFrame extends JFrame {
|
||||||
startMultiplayerGame multiplayerGame = new startMultiplayerGame(this);
|
startMultiplayerGame multiplayerGame = new startMultiplayerGame(this);
|
||||||
coinToss coinToss = new coinToss(this);
|
coinToss coinToss = new coinToss(this);
|
||||||
Verbinden verbinden = new Verbinden(this);
|
Verbinden verbinden = new Verbinden(this);
|
||||||
|
WinLooseScreen winLooseScreen = new WinLooseScreen(this,true);
|
||||||
// Panels hinzufügen
|
// Panels hinzufügen
|
||||||
mainPanel.add(mainMenuView, "MainMenu");
|
mainPanel.add(mainMenuView, "MainMenu");
|
||||||
mainPanel.add(localGame, "LocalGame");
|
mainPanel.add(localGame, "LocalGame");
|
||||||
mainPanel.add(multiplayerGame, "MultiplayerGame");
|
mainPanel.add(multiplayerGame, "MultiplayerGame");
|
||||||
mainPanel.add(coinToss, "coinToss");
|
mainPanel.add(coinToss, "coinToss");
|
||||||
mainPanel.add(verbinden, "Verbinden");
|
mainPanel.add(verbinden, "Verbinden");
|
||||||
|
mainPanel.add(winLooseScreen, "WinLooseScreen");
|
||||||
|
|
||||||
// Hauptpanel in JFrame hinzufügen
|
// Hauptpanel in JFrame hinzufügen
|
||||||
add(mainPanel);
|
add(mainPanel);
|
||||||
|
|
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue