diff --git a/src/main/java/musicplayer/PlayerGUI.java b/src/main/java/musicplayer/PlayerGUI.java index e8d29cf..6203674 100644 --- a/src/main/java/musicplayer/PlayerGUI.java +++ b/src/main/java/musicplayer/PlayerGUI.java @@ -40,7 +40,6 @@ public class PlayerGUI implements PlayerCallbackInterface, LibraryCallbackInterf public PlayerGUI() { createUI(); - DatabaseManager.init(); resetTree(); Thread seekBarUpdater = new Thread(() -> { boolean running = true; @@ -58,6 +57,7 @@ public class PlayerGUI implements PlayerCallbackInterface, LibraryCallbackInterf } public static void main(String[] args) { + DatabaseManager.init(); PlayerGUI playerGUI = new PlayerGUI(); JFrame frame = new JFrame(); frame.setContentPane(playerGUI.mainPanel); @@ -347,7 +347,10 @@ public class PlayerGUI implements PlayerCallbackInterface, LibraryCallbackInterf toolBar.add(playButton); JButton pauseButton = new JButton("Pause"); pauseButton.setMnemonic('E'); - pauseButton.addActionListener(e -> player.pause()); + pauseButton.addActionListener(e -> { + player.pause(); + setSongHighlighting(player.getCurrentSong()); // Resume won't function if a different song is selected. + }); toolBar.add(pauseButton); JButton stopButton = new JButton("Stop"); stopButton.setMnemonic('S');