diff --git a/src/main/java/musicplayer/PlayerGUI.java b/src/main/java/musicplayer/PlayerGUI.java index a6ce247..7fffe9d 100644 --- a/src/main/java/musicplayer/PlayerGUI.java +++ b/src/main/java/musicplayer/PlayerGUI.java @@ -321,7 +321,10 @@ public class PlayerGUI implements PlayerCallbackInterface, LibraryCallbackInterf playList.setComponentPopupMenu(popupMenu); popupMenu = new JPopupMenu(); menuItem = new JMenuItem("Clear all"); - menuItem.addActionListener((e) -> playlistTableModel.removeAll()); + menuItem.addActionListener((e) -> { + playlistTableModel.removeAll(); + player.stop(); + }); popupMenu.add(menuItem); playlistScroll.setComponentPopupMenu(popupMenu); playlistScroll.setViewportView(playList);