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 {
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;