GUI Update
This commit is contained in:
@@ -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<String> comboBox = new JComboBox<String>();
|
||||
private JComboBox<String> spielername = new JComboBox<String>();
|
||||
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<spielerverwaltung.gethighscoreTabelle().length; i++) {
|
||||
comboBox.addItem(spielerverwaltung.gethighscoreTabelle()[i][0]);
|
||||
spielername.addItem(spielerverwaltung.gethighscoreTabelle()[i][0]);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -469,6 +477,12 @@ public class Dashboard_GUI extends JPanel{
|
||||
|
||||
}
|
||||
|
||||
public String getspielername(){
|
||||
System.out.println("DASHBOARD_GUI: " + spielername.getEditor().getItem());
|
||||
|
||||
return (String) (spielername.getEditor().getItem());
|
||||
}
|
||||
|
||||
public void gewonnen(Spieler spieler) {
|
||||
|
||||
if(spieler == SPIELER) {
|
||||
|
@@ -40,7 +40,6 @@ public class GUI extends JFrame{
|
||||
public GUI (Texturenpakete texturenpakete, Spielerverwaltung speicherung) {
|
||||
setMinimumSize(new Dimension(1000, 600));
|
||||
|
||||
|
||||
// jaujau.getAktuellesSpiel();
|
||||
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
setTitle("JauJau");
|
||||
|
Reference in New Issue
Block a user