In the JavaFX Scene Builder, is it somehow possible to view the FXML code for the current layout without saving to a file and view the saved file?

有帮助吗?

解决方案

right click on the root node in scene builder and then choose copy . and paste it in any text editor.

enter image description here

out put :

<Group id="sb-clipboard" xmlns:fx="http://javafx.com/fxml">
  <fx:define>
    <AnchorPane id="AnchorPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0">
      <children>
        <Button id="button1" layoutX="140.0" layoutY="104.0" mnemonicParsing="false" text="Button" />
        <RadioButton id="radioButton1" layoutX="283.0" layoutY="172.0" mnemonicParsing="false" text="RadioButton" />
        <ToggleButton id="toggleButton1" layoutX="94.0" layoutY="234.0" mnemonicParsing="false" text="ToggleButton" />
      </children>
    </AnchorPane>
  </fx:define>
</Group>
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top