javafx场景构建器1.1中的JAR / FXML Manager选项位于何处? [英] where is located JAR/FXML Manager option in javafx scene builder 1.1?

查看:307
本文介绍了javafx场景构建器1.1中的JAR / FXML Manager选项位于何处?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这就是我想要找到的。





这就是我的javafx场景构建器1.1的样子。我已经调查了所有选项,但我无法弄清楚。



解决方案

我非常有兴趣知道你为什么要使用2013年的Scene Builder 1.1。我想因为你必须用JDK 7维护一些遗留的JavaFX代码?



我猜你也知道可以找到Scene Builder的当前版本



您可以在此处指定您的jar:





你必须点击申请然后你就可以打开你的fxml:





现在,如果您检查fxml文件,您会注意到将包含类路径:

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

这仅适用于此文件。请注意 scenebuilder-classpath-element 标记是



如果你想要一个更永久的解决方案,你可以直接将jar添加到 app 文件夹中(可能你会在下找到它:C:\Program Files(x86)\ Oracle \ JavaFX Scene Builder 1.1 \\\ )。



你必须编辑 package.cfg 文件来添加:

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

保存并启动SB 1.1。现在,您将能够直接打开fxml文件或任何其他需要第三方jar的文件。


This is what i'm trying to find.

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

解决方案

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.

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:

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

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

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.

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)\Oracle\JavaFX Scene Builder 1.1\app).

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

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.

这篇关于javafx场景构建器1.1中的JAR / FXML Manager选项位于何处?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆