在javafx2中,我试图在fxml中创建一个对象。我想从控制器中引用它吗?
<BorderPane>
<center>
<Path id="ad"/>
</center>
</BorderPane>
不工作吗?有什么想法吗?
Whoops需要在fxml文件中导入Path。
<?import javafx.scene.shape.Path?>
还需要在打开标记中添加一个fx:id。例如:
<BorderPane>
<center>
<Path id="ad" fx:id="ad1"/>
</center>
</BorderPane>