What's wrong with my program, I keep getting error "arrow.java:42: error: cannot find symbol"

What's wrong with my program, I keep getting error "arrow.java:42: error: cannot find symbol"

我目前正在大学学习一些编程 类,我们正在做一个作业来创建一个可以通过击键(R 或 B)和鼠标点击(左和右)。我已经进行了大约一个小时的故障排除,但一直卡在这个错误上。

"arrow.java:42: 错误: 找不到符号 primaryStage.SetTitle("用键或鼠标给箭头上色")

这是我的代码,如果它也有帮助的话。

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.StackPane;
import javafx.scene.paint.Color;
import javafx.stage.Stage;
import javafx.scene.shape.Polygon;
import javafx.scene.input.MouseButton;
import javafx.scene.input.KeyCode;
public class Arrow extends Application {
    @Override // Override the start method in the Application class
    public void start(Stage primaryStage) {
        StackPane pane = new StackPane();
        
        //Create an arrow and place it in the pane
        Polygon arrow = new Polygon();
        arrow.setFill(Color.WHITE);
        arrow.setStroke(Color.BLACK);
        arrow.getPoints().addAll(50.0,50.0, 150.0,50.0, 150.0,0.0, 250.0,100.0, 150.0,200.0, 50.0,150.0);
        pane.getChildren().add(arrow);
        
        //Add a mouse click handler to the arrow
        arrow.setOnMouseClicked(e -> {
            if (e.getButton() == MouseButton.PRIMARY) {
                arrow.setFill(Color.RED);
            }
            else if (e.getButton() == MouseButton.SECONDARY) {
                arrow.setFill(Color.BLUE);
            }
        });
        //Create a scene and place it in the stage
        Scene scene = new Scene(pane, 400, 400);
        scene.setOnKeyPressed (e -> {
            if (e.getCode() == KeyCode.R) {
                arrow.setFill(Color.RED);
            }
            else if (e.getCode() == KeyCode.B) {
                arrow.setFill(Color.BLUE);
            }
        });
        
        primaryStage.SetTitle("Color an Arrow with Key or Mouse"); // Set the stage title
        primaryStage.setScene(scene); //Place the scene in the stage
        primaryStage.show(); //Display the Stage
    }
}

使用“setTitle”代替“SetTitle”