Advertisement
Guest User

Untitled

a guest
Feb 12th, 2016
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. public static void Highscore(List<Highscore> data) {
  2.  
  3. String HighscoreList = "";
  4.  
  5. try {
  6. //Textfilens name
  7. String filname = "Highscore.txt";
  8. Scanner inFil = new Scanner(new File(filname));
  9.  
  10. while(inFil.hasNext()) {
  11.  
  12. String name = inFil.next();
  13. String percent = inFil.next();
  14.  
  15. HighscoreLista += name + "n" + percent + "%" + "nn";
  16.  
  17. } inFil.close();
  18. } catch (FileNotFoundException e1) {
  19. JOptionPane.showMessageDialog(null,"File was not found!");
  20. }
  21. JOptionPane.showMessageDialog(null, HighscoreList);
  22.  
  23. }//Highscore ends
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement