From ee6d59f3b04e15acb065dbfa873904551a43b902 Mon Sep 17 00:00:00 2001 From: ekresse Date: Tue, 5 Jan 2021 11:22:04 +0100 Subject: [PATCH] GUI Update Without Game UI --- highscore.txt | 14 ++- src/de/jaujau/gui/Dashboard_GUI.java | 126 ++++++++++++++++++++++++++ src/de/jaujau/gui/GUI.java | 81 ++++++++++++++--- src/de/jaujau/gui/Menue_GUI.java | 119 ------------------------ src/de/jaujau/gui/Navigation_GUI.java | 17 +--- src/de/jaujau/gui/Spiel_GUI.java | 13 ++- 6 files changed, 218 insertions(+), 152 deletions(-) create mode 100644 src/de/jaujau/gui/Dashboard_GUI.java delete mode 100644 src/de/jaujau/gui/Menue_GUI.java diff --git a/highscore.txt b/highscore.txt index e427f54..510cefa 100644 --- a/highscore.txt +++ b/highscore.txt @@ -1,5 +1,15 @@ Seb 245 Elmo 240 Moritz 220 -Alaa Aldin 217 -Fabian 215 \ No newline at end of file +Alaa-Aldin 217 +Fabian 215 +Thomas 1233 +Emil -21331 +Heinz +312 +Gert 234 +Kasper 24 +Jens 234 +Paul 234 +Till 553 +Reiner 462 +Achim 2344 diff --git a/src/de/jaujau/gui/Dashboard_GUI.java b/src/de/jaujau/gui/Dashboard_GUI.java new file mode 100644 index 0000000..4ad7d8f --- /dev/null +++ b/src/de/jaujau/gui/Dashboard_GUI.java @@ -0,0 +1,126 @@ +package de.jaujau.gui; +import java.awt.BorderLayout; +import java.awt.CardLayout; +import java.awt.Color; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.JTable; +import javax.swing.table.DefaultTableModel; + +import de.jaujau.daten.Spielerverwaltung; +import javax.swing.JTextField; +import javax.swing.JLabel; +import javax.swing.BoxLayout; +import javax.swing.ComboBoxModel; +import javax.swing.DefaultComboBoxModel; + +import java.awt.Dimension; +import java.awt.event.ActionListener; + +import javax.swing.JComboBox; + +public class Dashboard_GUI extends JPanel{ + private static final long serialVersionUID = -7380187913989942586L; + JPanel panelCont = new JPanel(); + JPanel highscore = new JPanel(); + JPanel start = new JPanel(); + Spiel_GUI Spiel_GUI = new Spiel_GUI(); + JPanel game = Spiel_GUI; + CardLayout cl = new CardLayout(); + Spielerverwaltung spielerverwaltung = new Spielerverwaltung(); + private final JPanel panel = new JPanel(); + private final JPanel panel_1 = new JPanel(); + private JComboBox comboBox = new JComboBox(); + private final JPanel panel_2 = new JPanel(); + private final JLabel lblNewLabel_1 = new JLabel("Entwickler: Sebastian, Moritz, Fabian, Aladin, Elmar"); + + public Dashboard_GUI() { + setLayout(new BorderLayout(0, 0)); + panelCont.setLayout(cl); + panelCont.add(highscore, "1"); + panelCont.add(game, "2"); + panelCont.add(start, "3"); + start.setLayout(new BorderLayout(0, 0)); + panel.setPreferredSize(new Dimension(10, 30)); + + start.add(panel, BorderLayout.NORTH); + + JLabel lblNewLabel = new JLabel("Spielername:"); + panel.add(lblNewLabel); + comboBox.setMinimumSize(new Dimension(60, 22)); + comboBox.setEditable(true); + panel.add(comboBox); + start.add(panel_1, BorderLayout.CENTER); + + start.add(panel_2, BorderLayout.SOUTH); + + panel_2.add(lblNewLabel_1); + + highscore.setLayout(new BorderLayout(0, 0)); + + cl.show(panelCont, "3"); + add(panelCont); + renderStart(); //Startseite beim ersten öffnen aktualisieren + } + + + public void showgame(){ + System.out.println("DASHBOARD: Game darstellen"); + cl.show(panelCont, "2"); + } + + public void showstart(){ + System.out.println("DASHBOARD: Start darstellen"); + cl.show(panelCont, "3"); + renderStart(); + } + + + public void showhighscore(){ + System.out.println("DASHBOARD: Highscore darstellen"); + renderHighscore(); + cl.show(panelCont, "1"); + repaint(); + revalidate(); + + } + + + + public void renderStart(){ + comboBox.removeAllItems(); + for(int i = 0; i