added scroll bar to viewer

This commit is contained in:
CT
2026-05-08 15:53:47 -05:00
parent 38f90ec94f
commit d73e5d29fd

View File

@@ -306,7 +306,11 @@ public class HockeyStats {
try { try {
switch (k) { switch (k) {
case 1: 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; break;
case 2: case 2:
String findName = String findName =
@@ -333,7 +337,11 @@ public class HockeyStats {
} }
int minGoals = Integer.parseInt(minInput); int minGoals = Integer.parseInt(minInput);
PlayerList pl = players.getPlayersGoalsAbove(minGoals); 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; break;
case 6: case 6:
statsExit = true; statsExit = true;