Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 javafx2 中,我试图在 fxml 中创建一个对象。然后我希望能够从控制器中引用它?
<BorderPane> <center> <Path id="ad"/> </center> </BorderPane>
不管用?有任何想法吗?
哎呀需要在 fxml 文件中导入路径。
<?import javafx.scene.shape.Path?>
还需要在开始标记中添加一个 fx:id。例如:
<BorderPane> <center> <Path id="ad" fx:id="ad1"/> </center> </BorderPane>