0

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:

  1. I'm using version 9.0.1 though v15 did had the same issue as well,
  2. The fxml was not opening in NetBeans either,
  3. 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,
  4. 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.

Kochez
  • 673
  • 4
  • 10

1 Answers1

1

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.

Kochez
  • 673
  • 4
  • 10
  • There is [some info on debugging scene builder](https://stackoverflow.com/questions/50482659/scene-builder-nested-custom-nodes/50493549), no idea if it would have helped you or not. My experience with jfoenix from answering other questions related to it is that it is a bit buggy. And jfoenix is more buggy if you try to use it in scene builder. Compatible versions of both are important, but even then it is still buggy. – jewelsea Apr 12 '22 at 05:10
  • There is more [troubleshooting info here](https://stackoverflow.com/questions/29444698/how-to-create-an-fxml-file-for-an-already-created-new-component-in-java-than-add/29444845#29444845). And info on [scenebuilder and jfoenix here](https://stackoverflow.com/questions/70985646/load-custom-components-in-scenebuilder-17/70988201#70988201). – jewelsea Apr 12 '22 at 05:15