import java.io.File;
import javafx.scene.media.Media;
import javafx.scene.media.MediaPlayer;
public class musicPlayer extends Thread{
@Override
public void run(){
String path = "bkgmsc.wav";
Media hit = new Media(new File(path).toURI().toString());
MediaPlayer mediaPlayer = new MediaPlayer(hit);
mediaPlayer.play();
}
public static void main(String[] args){
(new musicPlayer()).start();
}
}
public static void main(String[] args) {
musicPlayer player = new musicPlayer();
player.start();
}
Exception in thread "Thread-0" MediaException: MEDIA_UNAVAILABLE :
at javafx.scene.media.Media.<init>(Media.java:407)
at simplesubbattlsehip.musicPlayer.run(musicPlayer.java:19)