-1

I am making a jukebox program to run independently on a raspberry pi using netbeans. I'm trying to write a method that allows for the music to switch after it has finished playing. I know how to create a listener, but I need to still have the JPanel operations working. As of now I have a button that will change a variable shuffle and I have the shuffle algorithm created. I need to know how to create a thread that listens to see if the thread the audio is played on is dead.

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433

1 Answers1

2

Use Clip.addLineListener(LineListener).

Instances of classes that implement the LineListener interface can register to receive events when a line's status changes.

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433