<AnchorPane id="back" prefHeight="400.0" prefWidth="600.0" style="-fx-background-image: url('file:com/example/test/background.png');" xmlns="http://javafx.com/javafx/19" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.example.test.Play">
图片用绝对路径可以,但是怎么能设置成相对路径
绝对路径如下:/Users/oneone/Downloads/SpaceAsteroid/src/main/resources/com/example/test/background.png