sort by goals

This commit is contained in:
Cool Guy
2026-05-13 20:00:22 +00:00
parent d73e5d29fd
commit 552de95add
2 changed files with 23 additions and 3 deletions

View File

@@ -280,8 +280,9 @@ public class HockeyStats {
(2) Find Player
(3) Sort By Name
(4) Sort By Points
(5) Show by Goals > num
(6) Return to Main Menu
(5) Sort By Goals
(6) Show by Goals > num
(7) Return to Main Menu
<---------------------------->
""";
@@ -327,6 +328,10 @@ public class HockeyStats {
JOptionPane.showMessageDialog(null, "Sorted by points");
break;
case 5:
players.sortByGoals();
JOptionPane.showMessageDialog(null, "Sorted by goals");
break;
case 6:
String minInput = JOptionPane.showInputDialog(null, "Enter the min goals to show:");
if (minInput == null) {
break;
@@ -343,7 +348,7 @@ public class HockeyStats {
JScrollPane showScrollPane = new JScrollPane(showTextArea);
JOptionPane.showMessageDialog(null, showScrollPane);
break;
case 6:
case 7:
statsExit = true;
break;
default: