I'm trying to create a popup window that goes something like this:

Number of Games Played: 2  

Total Score: 10  

Average Score: 5

I have the numbers 2, 10, and 5 stored inside of a text file. I just want to be able to read the numbers from the text file into a (and this is where I get confused) a JLabel or a JTextArea? I also want to be able to clear the scores and reset them all to 0. Which I don't think should be too hard, but I could be wrong. Should I be storing the numbers into an ArrayList when I read them in?

Here is the code I have so far:

```
import javax.swing.*;
import java.awt.*;
import java.io.*;
import java.util.Scanner;

public class HistoryPopUp {

    JFrame history;
    JPanel panel;
    JLabel numGames, totalScore, avgScore;
    JTextArea games,score,aScore;
    JButton clearHistory;

    HistoryPopUp(){
        history = new JFrame();
        panel = new JPanel(new GridLayout(3, 1));
        numGames = new JLabel("Number of Games Played: ");
        totalScore = new JLabel("Total Score: ");
        avgScore = new JLabel("Average Score: ");
        games = new JTextArea();
        score = new JTextArea();
        aScore = new JTextArea();

        clearHistory = new JButton();

        try {
            String textLine;
            FileReader fr = new FileReader("history.txt");
            BufferedReader reader = new BufferedReader(fr);
            while((textLine=reader.readLine()) != null){
                textLine = reader.readLine();
                games.read(reader,"Something");
                score.read(reader, "seomthing");
                aScore.read(reader,"balh");
            }

            reader.close();

        }catch(IOException ex){
                System.out.println("ABORT! YOU KILLED IT!!");
            }

        history.pack();
        history.setVisible(true);

        panel.add(games);
        panel.add(score);
        panel.add(aScore);

        JOptionPane.showMessageDialog(null, panel, "History of Games Played", JOptionPane.PLAIN_MESSAGE);

    }
}

```

EDIT: Formatting