diff --git a/HockeyStats.java b/HockeyStats.java index 080a224..5be0823 100644 --- a/HockeyStats.java +++ b/HockeyStats.java @@ -306,7 +306,11 @@ public class HockeyStats { try { switch (k) { case 1: - JOptionPane.showMessageDialog(null, players.toString()); + String printData = players.toString(); + JTextArea printTextArea = new JTextArea(printData, 15, 60); + printTextArea.setEditable(false); + JScrollPane printScrollPane = new JScrollPane(printTextArea); + JOptionPane.showMessageDialog(null, printScrollPane); break; case 2: String findName = @@ -333,7 +337,11 @@ public class HockeyStats { } int minGoals = Integer.parseInt(minInput); PlayerList pl = players.getPlayersGoalsAbove(minGoals); - JOptionPane.showMessageDialog(null, pl.toString()); + String showData = pl.toString(); + JTextArea showTextArea = new JTextArea(showData, 15, 60); + showTextArea.setEditable(false); + JScrollPane showScrollPane = new JScrollPane(showTextArea); + JOptionPane.showMessageDialog(null, showScrollPane); break; case 6: statsExit = true;