where is located JAR/FXML Manager option in javafx scene builder 1.1?


where is located JAR/FXML Manager option in javafx scene builder 1.1?



This is what i'm trying to find.



enter image description here



This is how my javafx scene builder 1.1 looks like. i have looked into all options but i couldn't figure out.



enter image description here




1 Answer
1



I am very intrigued to know why you want to work with Scene Builder 1.1 which dates from 2013. I guess because you have to maintain some legacy JavaFX code with JDK 7?



I'd guess as well that you are aware that the current version for Scene Builder can be found here, and it supports JDK 8 and JDK 10.



Anyway, back to your question, the bad news is that Scene Builder 1.1 didn't have a menu for managing jar/fxml files. You can find more about this in this issue:



This functionality is now available in SB 2.0 Preview



The good news is that it had some kind of basic support for third party components. There are two ways you can enable a third party component:



If your fxml file includes some import not available in the classpath, SB will show a dialog to allow you adding the required jar to the classpath.



A more permanent solution (for every fxml, without this dialog) can be done by adding the jar directly to the app folder, and edit a cfg file to include it.


app



I had to search between my old files from that time to find some valid use case to test this. We can use a JFXtras jar from version 2.2 ('org.jfxtras:jfxtras-labs:2.2-r5') that can be downloaded from here.



You can create a fxml with one of its controls:


<?xml version="1.0" encoding="UTF-8"?>
<?import java.lang.*?>
<?import javafx.scene.layout.*?>
<?import jfxtras.labs.scene.control.*?>

<AnchorPane prefHeight="400.0" prefWidth="600.0" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/2.2">
<children>
<BigDecimalField layoutX="160.0" layoutY="132.0" />
</children>
</AnchorPane>



Now if you try to open this fxml with SB 1.1 you will get the dialog:



import dialog



Here is where you can specify your jar(s):



Add jars



You have to click Apply and then you will be able to open your fxml:


Apply



SB1.1



Now if you check the fxml file, you will notice the classpath will be included:


<?import jfxtras.labs.scene.control.*?>
<?scenebuilder-classpath-element C:/tmp/jfxtras-labs-2.2-r5.jar?>



This will work for this file only. And be aware that the scenebuilder-classpath-element tag was removed with SB 2.0.


scenebuilder-classpath-element



If you want a more permanent solution, you can add the jar directly to the app folder (probably you will find it under C:Program Files (x86)OracleJavaFX Scene Builder 1.1app).


app


C:Program Files (x86)OracleJavaFX Scene Builder 1.1app



And you have to edit the package.cfg file to add this:


package.cfg


app.classpath=scenebuilder.jar;jfxtras-labs-2.2-r5.jar



Save and launch SB 1.1. Now you will be able to open directly the fxml file or any other that requires that third party jar.






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Extract Id from Twitch Clip URL

Why are these constructs (using ++) undefined behavior in C?

I'm Still Waiting (Diana Ross song)