JavaFX; Eclipse将错误指向主要方法

时间:2018-12-10 02:43:53

标签: java javafx

我正在尝试学习JavaFX,并使用了以下视频中的代码:https://www.youtube.com/watch?v=FLkOX4Eez6o
我有Google,但找不到解决方案。
然后Eclipse IDE显示此错误:enter image description here

import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;

public class Testes extends Application{

    Button botao;

    public static void main(String[] args) {
        launch(args);
    }

    @Override
    public void start(Stage primaryStage) throws Exception {
        primaryStage.setTitle("Controle de processos");

        botao = new Button();
        botao.setText("+");

        StackPane layout = new StackPane();
        layout.getChildren().add(botao);

        Scene cena = new Scene(layout, 300, 250);
        primaryStage.setScene(cena);
        primaryStage.show();
    }
}

0 个答案:

没有答案