From 4708fb0e1f622d714d284b242da3db3f389a0eb3 Mon Sep 17 00:00:00 2001 From: ekresse Date: Mon, 11 Jan 2021 14:51:13 +0100 Subject: [PATCH] GUI Update --- src/de/jaujau/gui/Dashboard_GUI.java | 26 ++++++++++++++++++++------ src/de/jaujau/gui/GUI.java | 1 - 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/src/de/jaujau/gui/Dashboard_GUI.java b/src/de/jaujau/gui/Dashboard_GUI.java index 45b1719..c646457 100644 --- a/src/de/jaujau/gui/Dashboard_GUI.java +++ b/src/de/jaujau/gui/Dashboard_GUI.java @@ -40,7 +40,7 @@ public class Dashboard_GUI extends JPanel{ Spielerverwaltung spielerverwaltung = new Spielerverwaltung(); private final JPanel panel = new JPanel(); private final JPanel panel_1 = new JPanel(); - private JComboBox comboBox = new JComboBox(); + private JComboBox spielername = new JComboBox(); private final JPanel panel_2 = new JPanel(); private final JLabel lblNewLabel_1 = new JLabel("Entwickler: Sebastian, Moritz, Fabian, Aladin, Elmar"); private final JPanel spielfeld = new JPanel(); @@ -69,6 +69,7 @@ public class Dashboard_GUI extends JPanel{ private final JLabel label_final = new JLabel("Spiel beendet"); private final JScrollPane gegnerkartenpane = new JScrollPane(); private final JPanel gegnerkarten = new JPanel(); + private final JButton getname = new JButton("setzen"); //Moving Image @@ -232,9 +233,16 @@ public class Dashboard_GUI extends JPanel{ JLabel lblNewLabel = new JLabel("Spielername:"); panel.add(lblNewLabel); - comboBox.setMinimumSize(new Dimension(60, 22)); - comboBox.setEditable(true); - panel.add(comboBox); + spielername.setMinimumSize(new Dimension(60, 22)); + spielername.setEditable(true); + panel.add(spielername); + panel.add(getname); + getname.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + getspielername(); + } + }); start.add(panel_1, BorderLayout.CENTER); start.add(panel_2, BorderLayout.SOUTH); @@ -284,9 +292,9 @@ public class Dashboard_GUI extends JPanel{ public void renderStart(){ - comboBox.removeAllItems(); + spielername.removeAllItems(); for(int i = 0; i