在SceneBuilder 2上没有打开fxml文件

时间:2015-02-28 20:16:57

标签: java javafx javafx-8 scenebuilder

这个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>

enter image description here

1 个答案:

答案 0 :(得分:1)

从FXML中的font="$x1"移除Labels。好像它们会引起问题。