I have my own JavaFx control that appears in my application. But I can not get SceneBuilder to understand this.
I have CustomTextField.java/CustomTextField.fxml. CustomTextField inherits from UserControl as defined here , but the problem with the script creator happens with any custom control that I create.
First, I had to change my import statement as a wildcard. From
<import sample.CustomTextField>
to
<import sample.*>
otherwise, the script threw an exception / showed a stacktrace indicating that the source file was not found. I have no idea why this was necessary, but it seemed to work, so I continued to move.
I read that you will also specify the scriptbuilder-classpath element in the fxml file. So, I tried every combination that I could think of:
<?scenebuilder-classpath-element ../../bin?> <?scenebuilder-classpath-element ../../out?> <?scenebuilder-classpath-element ../../../out?> <?scenebuilder-classpath-element ./?> <?scenebuilder-classpath-element ../../../../../target/classes?>
My problem is that the user control is not displayed in Scene Builder. Selecting it in the hiearchy tree, he indicates that "The selection contains unresolved links." If I can not drag the user control, this is acceptable. However, I really want to do this in Scene Builder and post other materials.
I am using IntelliJ IDEA 14 and Scene Builder 2.0
sample.fxml:
<?xml version="1.0" encoding="UTF-8"?> <?import javafx.scene.control.*?> <?import javafx.scene.layout.*?> <?import sample.*?> <?scenebuilder-classpath-element ../../bin?> <?scenebuilder-classpath-element ../../out?> <?scenebuilder-classpath-element ../../../out?> <?scenebuilder-classpath-element ./?> <?scenebuilder-classpath-element ../../../../../target/classes?> <Pane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1"> <children> <Button fx:id="topButton" layoutY="2.0" mnemonicParsing="false" text="Button Top" /> <CustomTextField fx:id="myCustomTextField" layoutX="1.0" layoutY="40.0" /> <Button layoutX="1.0" layoutY="125.0" mnemonicParsing="false" text="Button Bot" /> </children> </Pane>

java intellij-idea javafx scenebuilder
Stealth rabbi
source share