JavaFX 场景生成器崩溃

标签 javafx scenebuilder gluon

我在屏幕生成器方面遇到一些问题。
对于某些 fxml,它会在加载后崩溃。我尝试了很多次来运行它,但它阻塞了,我必须终止进程。

fxml 正常,内容在我的应用程序中正确显示。这是我的 FXML 导致场景生成器崩溃的示例。

<?xml version="1.0" encoding="UTF-8"?>

<?import com.jfoenix.controls.JFXTabPane?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import java.lang.String?>
<?import java.net.URL?>
<AnchorPane xmlns:fx="http://javafx.com/fxml/1" id="mainApplicationWindow" fx:id="mainApplicationWindow"
            styleClass="mainAnchorPane, gt-screen" xmlns="http://javafx.com/javafx/8.0.112-ea"
            fx:controller="com.genealogytree.client.desktop.controllers.implementation.PaneMainApplicationWindowController">
    <stylesheets>
        <URL value="@/layout/style/gentree.css"/>
    </stylesheets>
    <children>
        <SplitPane dividerPositions="0.2809364548494983" layoutX="139.0" layoutY="78.0" orientation="VERTICAL"
                   prefHeight="200.0" prefWidth="160.0" styleClass="gt-splitpane" AnchorPane.bottomAnchor="0.0"
                   AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
            <items>
                <AnchorPane maxHeight="220.0" minHeight="220.0" prefHeight="220.0">
                    <children>
                        <JFXTabPane fx:id="gtMainTabPane" AnchorPane.bottomAnchor="10" AnchorPane.leftAnchor="20"
                                    AnchorPane.rightAnchor="20" AnchorPane.topAnchor="10">
                            <tabs>
                            </tabs>
                        </JFXTabPane>
                    </children>
                </AnchorPane>
                <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="100.0" prefWidth="160.0">
                    <children>
                        <SplitPane dividerPositions="0.22690763052208834" layoutX="55.0" layoutY="46.0"
                                   prefHeight="160.0" prefWidth="200.0" styleClass="gt-splitpane"
                                   AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0"
                                   AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
                            <items>
                                <AnchorPane id="splitPaneHorizontal" maxWidth="250.0" minWidth="250.0"
                                            prefWidth="250.0">
                                    <children>

                                        <TableView fx:id="gtFamilyMemberTable" layoutX="20.0" layoutY="12.0"
                                                   onMouseClicked="#showInfoMember" prefHeight="200.0" prefWidth="200.0"
                                                   AnchorPane.bottomAnchor="50.0" AnchorPane.leftAnchor="10.0"
                                                   AnchorPane.rightAnchor="10.0" AnchorPane.topAnchor="5.0">
                                            <columns>
                                                <TableColumn fx:id="simNameColumn" maxWidth="110.0" minWidth="110.0"
                                                             prefWidth="-1.0" text="%simName"/>
                                                <TableColumn fx:id="simSurnameColumn" maxWidth="110.0" minWidth="110.0"
                                                             prefWidth="-1.0" text="%simSurname"/>
                                            </columns>
                                            <styleClass>
                                                <String fx:value="firstTypeTable"/>
                                                <String fx:value="tableMembersAndRelations"/>
                                            </styleClass>
                                        </TableView>
                                        <TableView id="gtFamilyRelationTable" fx:id="gtFamilyRelationTable"
                                                   layoutX="20.0" layoutY="12.0" onMouseClicked="#showInfoRelation"
                                                   prefHeight="200.0" prefWidth="200.0" AnchorPane.bottomAnchor="50.0"
                                                   AnchorPane.leftAnchor="10.0" AnchorPane.rightAnchor="10.0"
                                                   AnchorPane.topAnchor="5.0">
                                            <columns>
                                                <TableColumn fx:id="relationSimLeftColumn" maxWidth="85.0"
                                                             minWidth="85.0" prefWidth="-1.0" text="%relation_sim"/>
                                                <TableColumn fx:id="relationTypeColumn" maxWidth="50.0" minWidth="50.0"
                                                             prefWidth="-1.0" text="%relation_type"/>
                                                <TableColumn fx:id="relationSimRightColumn" maxWidth="85.0"
                                                             minWidth="85.0" prefWidth="-1.0" text="%relation_sim"/>

                                            </columns>
                                            <styleClass>
                                                <String fx:value="firstTypeTable"/>
                                                <String fx:value="tableMembersAndRelations"/>
                                            </styleClass>
                                        </TableView>
                                        <AnchorPane id="anchorToogleButtons" prefHeight="25.0"
                                                    AnchorPane.bottomAnchor="10.0" AnchorPane.leftAnchor="10"
                                                    AnchorPane.rightAnchor="10.0">
                                            <ToggleButton id="buttonShowMemberTable" fx:id="buttonShowMemberTable"
                                                          layoutX="23.0" mnemonicParsing="false"
                                                          prefWidth="114.0" styleClass="toogleButtonShowTable"
                                                          text="Members" AnchorPane.bottomAnchor="0.0"
                                                          AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="0.0"/>

                                            <ToggleButton id="buttonShowRelationTable" fx:id="buttonShowRelationTable"
                                                          layoutX="125.0" layoutY="12.0" mnemonicParsing="false"
                                                          prefWidth="114.0"
                                                          styleClass="toogleButtonShowTable" text="Relations"
                                                          AnchorPane.bottomAnchor="0.0" AnchorPane.rightAnchor="0.0"
                                                          AnchorPane.topAnchor="0.0"/>
                                        </AnchorPane>

                                    </children>
                                </AnchorPane>
                                <AnchorPane fx:id="workAnchorPane">
                                    <children>
                                        <AnchorPane fx:id="workAnchorPaneContent" AnchorPane.bottomAnchor="50.0"
                                                    AnchorPane.leftAnchor="10.0" AnchorPane.rightAnchor="20.0"
                                                    AnchorPane.topAnchor="5.0">

                                        </AnchorPane>
                                    </children>
                                </AnchorPane>
                            </items>
                        </SplitPane>
                    </children>
                </AnchorPane>
            </items>
        </SplitPane>
    </children>
</AnchorPane>

最佳答案

先尝试以管理员身份打开 SceneBuilder,然后再在 IDE 中打开文件。不知道为什么这有效,但它让我启动并运行。

关于JavaFX 场景生成器崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43557898/

相关文章:

java - 错误自己的 Maven 依赖关系到新的 FXML 项目

JavaFX:选项卡内的锚定 Pane 约束

java - Gluon Project-当我运行/.gradle运行时找不到Springboot依赖关系

android - 使用 javafx 在 android 中创建推送通知

gluon - 访问 Gluon Mobile 中的图像文件夹

JavaFX - 阻止用户在不使用 MODAL 的情况下更改阶段

JAVAFX 在 FXML Gridpane 中添加动态元素

java - 如何使 FXML 生成的按钮起作用

java - Eclipse JavaFX Scene Builder 向 GUI 添加 ButtonBar 或分组按钮

java - 我想在执行点击事件时获取GridPane的索引