import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.layout.Pane; import javafx.scene.paint.Color; import javafx.scene.shape.Line; import javafx.stage.Stage; public class AimingAssist extends Application { private static final int WINDOW_WIDTH = 800; private static final int WINDOW_HEIGHT = 600; private static final int CROSSHAIR_SIZE = 20; @Override public void start(Stage primaryStage) { Pane root = new Pane(); // 创建水平和垂直线 Line horizontalLine = new Line(0, WINDOW_HEIGHT / 2, WINDOW_WIDTH, WINDOW_HEIGHT / 2); Line verticalLine = new Line(WINDOW_WIDTH / 2, 0, WINDOW_WIDTH / 2, WINDOW_HEIGHT); // 设置线条样式 horizontalLine.setStroke(Color.RED); verticalLine.setStroke(Color.RED); horizontalLine.setStrokeWidth(2); verticalLine.setStrokeWidth(2); root.getChildren().addAll(horizontalLine, verticalLine); Scene scene = new Scene(root, WINDOW_WIDTH, WINDOW_HEIGHT); primaryStage.setTitle("简单瞄准辅助"); primaryStage.setScene(scene); primaryStage.show(); } public static void main(String[] args) { launch(args); } }