实际的设置方式一行代码就可以搞定:
public void start(Stage stage) throws Exception {
longStart();
Parent root = FXMLLoader.load(getClass().getResource("FXMLDocument.fxml"));
Scene scene = new Scene(root);
stage.setScene(scene);
stage.initStyle(StageStyle.UNDECORATED);//设定窗口无边框
stage.show();
}