diff --git a/PR2Projekt/src/de/hs_mannheim/informatik/pr2projekt/gui/HighscoreGUI.java b/PR2Projekt/src/de/hs_mannheim/informatik/pr2projekt/gui/HighscoreGUI.java index e79415f..104b3a6 100644 --- a/PR2Projekt/src/de/hs_mannheim/informatik/pr2projekt/gui/HighscoreGUI.java +++ b/PR2Projekt/src/de/hs_mannheim/informatik/pr2projekt/gui/HighscoreGUI.java @@ -1,10 +1,60 @@ package de.hs_mannheim.informatik.pr2projekt.gui; +import java.awt.BorderLayout; +import java.awt.GridLayout; + +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JPanel; + public class HighscoreGUI { - public static void highscoreScreen() { - // TODO Auto-generated method stub - - } + public static void highscoreScreen(String[] filepath){ + JFrame frame = new JFrame("Highscores"); + JPanel highscorePanel = new JPanel(new BorderLayout()); + JPanel buttonPanel = new JPanel(new GridLayout(7,1,10,10)); + String[] buttons = { + "Highscore 4x4 - leicht", + "Highscore 5x5 - leicht", + "Highscore 8x8 - leicht", + "Highscore 8x8 - medium", + "Highscore 10x10 - medium", + "Highscore 15x15 - medium" + }; + for(int i=0;i { + int j = count[0]; + String[] paths = { + "Hitori_Highscores/Hitori4x4_leicht.txt", + "Hitori_Highscores/Hitori5x5leicht.txt", + "Hitori_Highscores/Hitori8x8leicht.txt", + "Hitori_Highscores/Hitori8x8medium.txt", + "Hitori_Highscores/Hitori10x10medium.txt", + "Hitori_Highscores/Hitori15x15_medium.txt" + }; + showHighscores(paths[j]); + frame.dispose(); + }); + } + JButton b = new JButton("Zurück"); + b.addActionListener(e -> { + frame.dispose(); + MenuGUI.getPath(filepath); + }); + buttonPanel.add(b); + frame.setVisible(true); + frame.setSize(600,600); + highscorePanel.add(buttonPanel, BorderLayout.CENTER); + JLabel text0 = new JLabel("Level für Highscore Liste auswählen!"); + highscorePanel.add(text0, BorderLayout.NORTH); + frame.setDefaultCloseOperation(0); + frame.add(highscorePanel); + } }