我正在尝试使用javafx创建一个videoplayer,但是当我尝试运行该类时,它会显示一些错误
public class MoviePlayer extends Application{
public static void main (String [] args){
launch(args);
}
@Override
public void start(Stage stage) throws Exception {
Group root = new Group();
Media media = new Media("C:\\Users\\goldAnthony\\Videos\\Whistle.mp4");
MediaPlayer player = new MediaPlayer(media);
MediaView view = new MediaView(player);
root.getChildren().add(view);
Scene scene = new Scene(root, 400, 400, Color.BLACK);
stage.setScene(scene);
stage.show();
player.play();
}
这是它显示的错误
Error: Could not find or load main class Player.VideoPlayer2
Java Result: 1
BUILD SUCCESSFUL (total time: 1 second)
有些人问我说代码工作正常,我真的不知道什么似乎是问题,因为它给出了上面这个错误