import javafx.application.Application; import javafx.fxml.FXMLLoader; import javafx.scene.Scene; import javafx.stage.Stage; public class Calculator extends Application { @Override public void start(Stage primaryStage) throws Exception { FXMLLoader loader = new FXMLLoader(getClass().getResource("Calculator.fxml")); Scene scene = new Scene(loader.load()); primaryStage.setTitle("简易计算器"); primaryStage.setScene(scene); primaryStage.show(); } public static void main(String[] args) { launch(args); } }