I tried out this video here: https://www.youtube.com/watch?v=ameD1ocbn9s
Now I want to change this, to play the file directly with java, with the javafx player:
String source = f.toURI().toString(); Media media = null; media = new Media(source); MediaPlayer mediaPlayer = new MediaPlayer(media); mediaPlayer.play();
But I get an "Toolkit not initialized" error. I cant figure out why this is happening?