Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void Highscore(List<Highscore> data) {
- String HighscoreList = "";
- try {
- //Textfilens name
- String filname = "Highscore.txt";
- Scanner inFil = new Scanner(new File(filname));
- while(inFil.hasNext()) {
- String name = inFil.next();
- String percent = inFil.next();
- HighscoreLista += name + "n" + percent + "%" + "nn";
- } inFil.close();
- } catch (FileNotFoundException e1) {
- JOptionPane.showMessageDialog(null,"File was not found!");
- }
- JOptionPane.showMessageDialog(null, HighscoreList);
- }//Highscore ends
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement