0
我有一個TextField和帶有mnemonicParsing true的標籤。我想用TextField的id設置標籤的labelFor屬性。我如何在FXML中做到這一點?JavaFx:如何在FXML中設置label的labelFor屬性?
<GridPane hgap="5.0" snapToPixel="false" vgap="10.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1">
<children>
<Label maxWidth="-Infinity" text="_A Label" GridPane.halignment="RIGHT" GridPane.hgrow="NEVER" GridPane.vgrow="NEVER" mnemonicParsing="true" />
<TextField id="myTextField" GridPane.columnIndex="1" GridPane.hgrow="NEVER" />
</children>
</GridPane>
感謝