为什么 Gluon SceneBuilder 无法正常工作
我一直在使用 SceneBuilder 9.0.1 在 IntelliJ 上做一个项目。昨天,12 点后由于某种原因没有开始新项目,在 NetBeans 8 上做了一个迷你项目。当我关闭所有内容并打开 IntelliJ 项目后,fxml 文档无法使用 SceneBuilder 打开。 对于这个问题,需要注意以下事项:
- 我使用的是版本 9.0.1,尽管 v15 也有同样的问题,
- fxml 也没有在 NetBeans 中打开,
- 重新安装将打开一个空白项目并打开一些最近的项目文件,但有些无法打开。关闭后,无法再次打开,
- 尝试打开后检查任务管理器。它将作为一个占用大量内存的后台进程可见。有时它只会在我关闭 IntelliJ 后出现。
其中一个 fxml 文件的示例如下:
<?xml version="1.0" encoding="UTF-8"?>
<?import com.jfoenix.controls.JFXButton?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.PasswordField?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.effect.Glow?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.BorderPane?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?>
<BorderPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="700.0" prefWidth="900.0" xmlns="http://javafx.com/javafx/9.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.example.vigilantdoodle.ApplicationLoginController">
<left>
<VBox alignment="CENTER" prefHeight="700.0" prefWidth="425.0" style="-fx-background-color: #003194;" BorderPane.alignment="CENTER">
<children>
<ImageView fitHeight="150.0" fitWidth="200.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@../../../icon_images/police-hat-icon.png" />
</image>
</ImageView>
<Label text="Kenya Police" textFill="#fff10b">
<font>
<Font name="System Bold" size="37.0" />
</font>
</Label>
</children>
</VBox>
</left>
<center>
<VBox alignment="CENTER" prefHeight="700.0" prefWidth="1200.0" BorderPane.alignment="CENTER">
<children>
<AnchorPane prefHeight="200.0" prefWidth="200.0">
<children>
<JFXButton fx:id="adminButton" layoutX="423.0" layoutY="2.0" onAction="#onToggleAdminClick" text="Admin" textFill="#003194" />
<Label layoutX="365.0" layoutY="5.0" text="Change to:" />
</children>
</AnchorPane>
<ImageView fitHeight="150.0" fitWidth="200.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@../../../icon_images/users-icon.png" />
</image>
</ImageView>
<Label text="Login" textFill="#003194">
<font>
<Font name="System Bold" size="36.0" />
</font>
</Label>
<Label fx:id="messageLabel" alignment="CENTER" contentDisplay="CENTER" text="Invalid login credentials" textAlignment="CENTER" textFill="#f85656" underline="true">
<font>
<Font name="System Bold" size="13.0" />
</font>
<effect>
<Glow />
</effect>
<VBox.margin>
<Insets top="40.0" />
</VBox.margin>
</Label>
<HBox alignment="CENTER" prefHeight="45.0" prefWidth="200.0" spacing="20.0">
<children>
<Label text="Username" textFill="#003194">
<font>
<Font name="System Bold" size="15.0" />
</font>
</Label>
<TextField fx:id="obNumberTextfield" />
</children>
<VBox.margin>
<Insets top="10.0" />
</VBox.margin>
</HBox>
<HBox alignment="CENTER" layoutX="10.0" layoutY="424.0" prefHeight="45.0" prefWidth="200.0" spacing="25.0">
<children>
<Label text="Password" textFill="#003194">
<font>
<Font name="System Bold" size="15.0" />
</font>
</Label>
<PasswordField fx:id="passwordTextfield" />
</children>
<VBox.margin>
<Insets bottom="30.0" top="20.0" />
</VBox.margin>
</HBox>
<JFXButton fx:id="loginButton" onAction="#onLoginButtonClick" prefHeight="35.0" prefWidth="250.0" style="-fx-background-color: yellow;" text="Log in" textFill="#003194">
<VBox.margin>
<Insets top="20.0" />
</VBox.margin>
<font>
<Font name="System Bold" size="18.0" />
</font>
</JFXButton>
<AnchorPane prefHeight="200.0" prefWidth="200.0">
<children>
<Label layoutX="117.0" layoutY="14.0" text="Investigating?">
<font>
<Font size="13.0" />
</font>
</Label>
<JFXButton fx:id="investigatingTextField" layoutX="191.0" layoutY="10.0" onAction="#onInvestigatingTextClick" text="Here" textFill="#003194">
<font>
<Font name="System Bold" size="13.0" />
</font>
</JFXButton>
</children>
</AnchorPane>
</children>
</VBox>
</center>
</BorderPane>
请帮助。
I have been doing a project and on IntelliJ with SceneBuilder 9.0.1. Yesterday, did a mini project on NetBeans 8 after 12 wasn't starting a new project for some reason. Once I was done on closing everything and opening my IntelliJ project, the fxml documents were not opening with the SceneBuilder.
With this problem, the following things need to be noted:
- I'm using version 9.0.1 though v15 did had the same issue as well,
- The fxml was not opening in NetBeans either,
- The reinstalling would open a blank project and open some recent files, but some would not open. After closing it, It would not open again,
- Checking the task manager after trying to open it. It would be visible as a background process taking quite some RAM. Sometimes it would only appear after I close IntelliJ
A sample of one of the fxml files is as below:
<?xml version="1.0" encoding="UTF-8"?>
<?import com.jfoenix.controls.JFXButton?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.PasswordField?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.effect.Glow?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.BorderPane?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?>
<BorderPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="700.0" prefWidth="900.0" xmlns="http://javafx.com/javafx/9.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.example.vigilantdoodle.ApplicationLoginController">
<left>
<VBox alignment="CENTER" prefHeight="700.0" prefWidth="425.0" style="-fx-background-color: #003194;" BorderPane.alignment="CENTER">
<children>
<ImageView fitHeight="150.0" fitWidth="200.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@../../../icon_images/police-hat-icon.png" />
</image>
</ImageView>
<Label text="Kenya Police" textFill="#fff10b">
<font>
<Font name="System Bold" size="37.0" />
</font>
</Label>
</children>
</VBox>
</left>
<center>
<VBox alignment="CENTER" prefHeight="700.0" prefWidth="1200.0" BorderPane.alignment="CENTER">
<children>
<AnchorPane prefHeight="200.0" prefWidth="200.0">
<children>
<JFXButton fx:id="adminButton" layoutX="423.0" layoutY="2.0" onAction="#onToggleAdminClick" text="Admin" textFill="#003194" />
<Label layoutX="365.0" layoutY="5.0" text="Change to:" />
</children>
</AnchorPane>
<ImageView fitHeight="150.0" fitWidth="200.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@../../../icon_images/users-icon.png" />
</image>
</ImageView>
<Label text="Login" textFill="#003194">
<font>
<Font name="System Bold" size="36.0" />
</font>
</Label>
<Label fx:id="messageLabel" alignment="CENTER" contentDisplay="CENTER" text="Invalid login credentials" textAlignment="CENTER" textFill="#f85656" underline="true">
<font>
<Font name="System Bold" size="13.0" />
</font>
<effect>
<Glow />
</effect>
<VBox.margin>
<Insets top="40.0" />
</VBox.margin>
</Label>
<HBox alignment="CENTER" prefHeight="45.0" prefWidth="200.0" spacing="20.0">
<children>
<Label text="Username" textFill="#003194">
<font>
<Font name="System Bold" size="15.0" />
</font>
</Label>
<TextField fx:id="obNumberTextfield" />
</children>
<VBox.margin>
<Insets top="10.0" />
</VBox.margin>
</HBox>
<HBox alignment="CENTER" layoutX="10.0" layoutY="424.0" prefHeight="45.0" prefWidth="200.0" spacing="25.0">
<children>
<Label text="Password" textFill="#003194">
<font>
<Font name="System Bold" size="15.0" />
</font>
</Label>
<PasswordField fx:id="passwordTextfield" />
</children>
<VBox.margin>
<Insets bottom="30.0" top="20.0" />
</VBox.margin>
</HBox>
<JFXButton fx:id="loginButton" onAction="#onLoginButtonClick" prefHeight="35.0" prefWidth="250.0" style="-fx-background-color: yellow;" text="Log in" textFill="#003194">
<VBox.margin>
<Insets top="20.0" />
</VBox.margin>
<font>
<Font name="System Bold" size="18.0" />
</font>
</JFXButton>
<AnchorPane prefHeight="200.0" prefWidth="200.0">
<children>
<Label layoutX="117.0" layoutY="14.0" text="Investigating?">
<font>
<Font size="13.0" />
</font>
</Label>
<JFXButton fx:id="investigatingTextField" layoutX="191.0" layoutY="10.0" onAction="#onInvestigatingTextClick" text="Here" textFill="#003194">
<font>
<Font name="System Bold" size="13.0" />
</font>
</JFXButton>
</children>
</AnchorPane>
</children>
</VBox>
</center>
</BorderPane>
Kindly Help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我几个小时后刚刚修好它。
原因是它抛出了异常(我假设是因为我无法判断),因为当我从 v8 迁移到 NetBeans 8 到 v9 时,我更改了 SceneBuilder 的 jfoenix 库。
我希望有一种方法让用户能够获得例外。现在运作良好。
I have just fixed it after hours.
The reason is that it was throwing an exception (I assume because I could not tell), since I had changed the SceneBuilder's jfoenix libraries when I moved to NetBeans 8 from v8 to v9.
I wish there was a way the users would be able to get the exception. Its working well now.