fxml 文件未在 SceneBuilder 2 上打开
fxml file not opening on SceneBuilder 2
这个 fxml 有什么问题?我在 SceneBuilder 2 上编辑它并保存它。
现在SceneBuilder拒绝打开它。
<?xml version="1.0" encoding="UTF-8"?>
<?import java.lang.*?>
<?import java.net.*?>
<?import java.util.*?>
<?import javafx.geometry.*?>
<?import javafx.scene.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.text.*?>
<AnchorPane id="AnchorPane" fx:id="root" prefHeight="666.0" prefWidth="853.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1">
<children>
<Label text="RESUMO DE OPERAÇÕES" AnchorPane.leftAnchor="27.0" AnchorPane.topAnchor="19.0">
<font>
<Font name="System Bold" size="20.0" />
</font>
</Label>
<Label labelFor="$tabelaAtivos" layoutX="14.0" layoutY="301.0" text="Resumo de Ativos em Custódia">
<font>
<Font name="System Bold" size="16.0" />
</font>
</Label>
<TableView id="" fx:id="tabelaAtivos" layoutY="333.0" prefHeight="319.0" prefWidth="825.0" AnchorPane.leftAnchor="14.0" AnchorPane.topAnchor="333.0">
<columns>
<TableColumn prefWidth="100.0" text="Ativo" />
<TableColumn prefWidth="100.0" text="Custódia" />
<TableColumn prefWidth="100.0" text="Preço Médio" />
<TableColumn prefWidth="75.0" text="Resultado" />
<TableColumn maxWidth="5000.0" minWidth="10.0" prefWidth="112.0" text="Proventos" />
<TableColumn maxWidth="5000.0" minWidth="10.0" prefWidth="92.0" text="Custos" />
<TableColumn maxWidth="5000.0" minWidth="10.0" prefWidth="89.0" text="Operações" />
</columns>
</TableView>
<TitledPane animated="false" collapsible="false" layoutX="225.0" layoutY="62.0" prefHeight="229.0" prefWidth="202.0" text="Totais">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
<children>
<VBox layoutX="88.0" layoutY="14.0" prefHeight="200.0" prefWidth="100.0" spacing="2.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<children>
<Label font="$x1" text="Resultado:" textFill="BLACK">
</Label>
<TextField fx:id="txtResultado" prefWidth="141.0" />
<Label font="$x1" text="Proventos:" textFill="BLACK">
</Label>
<TextField fx:id="txtProventos" prefWidth="141.0" />
<Label font="$x1" text="Custos:" textFill="BLACK">
</Label>
<TextField fx:id="txtCustos" prefWidth="141.0" />
<Label text="Operações:" />
<TextField fx:id="txtOperacoes" prefWidth="200.0" />
</children>
</VBox>
</children>
</AnchorPane>
</content>
</TitledPane>
</children>
</AnchorPane>
从 FXML 中的 Labels
中删除 font="$x1"
。好像它们会引起问题。
这个 fxml 有什么问题?我在 SceneBuilder 2 上编辑它并保存它。 现在SceneBuilder拒绝打开它。
<?xml version="1.0" encoding="UTF-8"?>
<?import java.lang.*?>
<?import java.net.*?>
<?import java.util.*?>
<?import javafx.geometry.*?>
<?import javafx.scene.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.text.*?>
<AnchorPane id="AnchorPane" fx:id="root" prefHeight="666.0" prefWidth="853.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1">
<children>
<Label text="RESUMO DE OPERAÇÕES" AnchorPane.leftAnchor="27.0" AnchorPane.topAnchor="19.0">
<font>
<Font name="System Bold" size="20.0" />
</font>
</Label>
<Label labelFor="$tabelaAtivos" layoutX="14.0" layoutY="301.0" text="Resumo de Ativos em Custódia">
<font>
<Font name="System Bold" size="16.0" />
</font>
</Label>
<TableView id="" fx:id="tabelaAtivos" layoutY="333.0" prefHeight="319.0" prefWidth="825.0" AnchorPane.leftAnchor="14.0" AnchorPane.topAnchor="333.0">
<columns>
<TableColumn prefWidth="100.0" text="Ativo" />
<TableColumn prefWidth="100.0" text="Custódia" />
<TableColumn prefWidth="100.0" text="Preço Médio" />
<TableColumn prefWidth="75.0" text="Resultado" />
<TableColumn maxWidth="5000.0" minWidth="10.0" prefWidth="112.0" text="Proventos" />
<TableColumn maxWidth="5000.0" minWidth="10.0" prefWidth="92.0" text="Custos" />
<TableColumn maxWidth="5000.0" minWidth="10.0" prefWidth="89.0" text="Operações" />
</columns>
</TableView>
<TitledPane animated="false" collapsible="false" layoutX="225.0" layoutY="62.0" prefHeight="229.0" prefWidth="202.0" text="Totais">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
<children>
<VBox layoutX="88.0" layoutY="14.0" prefHeight="200.0" prefWidth="100.0" spacing="2.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<children>
<Label font="$x1" text="Resultado:" textFill="BLACK">
</Label>
<TextField fx:id="txtResultado" prefWidth="141.0" />
<Label font="$x1" text="Proventos:" textFill="BLACK">
</Label>
<TextField fx:id="txtProventos" prefWidth="141.0" />
<Label font="$x1" text="Custos:" textFill="BLACK">
</Label>
<TextField fx:id="txtCustos" prefWidth="141.0" />
<Label text="Operações:" />
<TextField fx:id="txtOperacoes" prefWidth="200.0" />
</children>
</VBox>
</children>
</AnchorPane>
</content>
</TitledPane>
</children>
</AnchorPane>
从 FXML 中的 Labels
中删除 font="$x1"
。好像它们会引起问题。