簡體   English   中英

為什么 Gluon SceneBuilder 無法正常工作

[英]Why is Gluon SceneBuilder Not Working Correctly

我一直在用 SceneBuilder 9.0.1 在 IntelliJ 上做一個項目。 昨天,在 NetBeans 上做了一個迷你項目 8 after 12 由於某種原因沒有開始新項目。 完成關閉所有內容並打開我的 IntelliJ 項目后,fxml 文檔無法使用 SceneBuilder 打開。 遇到這個問題,需要注意以下幾點:

  1. 我使用的是 9.0.1 版,盡管 v15 也有同樣的問題,
  2. fxml 也沒有在 NetBeans 中打開,
  3. 重新安裝將打開一個空白項目並打開一些最近的文件,但有些不會打開。 關了之后就打不開了
  4. 嘗試打開后檢查任務管理器。 它作為一個占用相當多 RAM 的后台進程是可見的。 有時它只會在我關閉 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>

請幫助。

幾個小時后我才修好它。

原因是它拋出異常(我假設是因為我不知道),因為當我將 NetBeans 8 從 v8 移動到 v9 時,我更改了 SceneBuilder 的 jfoenix 庫。

我希望有一種方法可以讓用戶獲得異常。 它現在運作良好。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM