Is there any source code for the JavaFX SceneBuilder

Daniel Fuchs daniel.fuchs at
Tue Oct 9 07:23:40 PDT 2012


SceneBuilder uses processing instructions in the FXML file to
store/read the classpath and location of the resource properties.

You can set those from within SceneBuilder itself:

[MenuBar] > Preview > Internationalization > Set Resource...
    lets you choose a properties file from which to resolve i18n keys

[MenuBar] > Preview > Resolve Unknown Types...
    lets you specify a class path against which to resolve unknown types.

Note that for working with custom types I'd recommend using
the Java FX SceneBuilder 1.1 developer preview - rather than
the 1.0 GA - as many fixes have been made regarding custom
types in 1.1 (in particular the bug that prevented the
classpath popup to show up when you started SB by double
clicking on an FXML file).

The processing instructions that Scene Builder uses should
be considered proprietary API for now - they might change
or be replaced by something else in the future.

If you look at the HelloI18N sample - you will see that it
the FXML contains a PI:


this tells SceneBuilder to use a file named located in
the same directory than the FXML file in order to resolve i18n keys.

if your layout had been:

    src/My Resources/

you would have seen:

<?scenebuilder-preview-i18n-resource ../My Resources/>

For the classpath it's basically the same: there is one PI line
per entry in the classpath, and the locations must be relative to the
FXML file - e.g - for a layout such as:


and a classpath=dist/myfirst.jar:dist/lib/mysecond.jar
you will find:

<?scenebuilder-classpath-element ../../dist/myfirst.jar?>
<?scenebuilder-classpath-element ../../dist/lib/mysecond.jar?>

If your FXML file contains custom type, scene builder will prompt
you to enter a classpath - which will be pre-populated with
the list of classpath element found in the FXML file.
Check the 'Set up classpath' checkbox and click on "Apply" to
apply the classpath.

Hope this helps,

-- daniel

> Message: 3
> Date: Tue, 09 Oct 2012 12:23:16 +0200
> From: Tom Schindl <tom.schindl at>
> Subject: Re: Is there any source code for the JavaFX SceneBuilder?
> To: openjfx-dev at
> Message-ID: <5073FB14.5060005 at>
> Content-Type: text/plain; charset=ISO-8859-1
> Am 09.10.12 12:14, schrieb Werner Lehmann:
>> This is also simple to do in Eclipse. The main problem I am having is,
>> how to pass the location of the resource bundle and especially the
>> classpath of my custom controls to SceneBuilder. Without this I am
>> seeing only black boxes (not necessarily black) instead of my custom
>> controls, and resource bundle keys like "%task-dialog-title" instead of
>> "Edit employee task".
>> In my case this classpath would be assembled from the output directories
>> of several dependent projects plus libraries.
>> Tom, is this something you managed to do in e(fx)clipse?
> No. My e(fx)clipse internal preview naturally has all those informations
> because it knows the classpath of the project.
> We'd need from the SceneBuilder people an API (once we directly embed
> the editor) and/or an interchange format to tell them where to search
> for classes.
> So if we (Eclipse,Netbeans,SceneBuilder) could work on an interchange
> format like
> scenebuilder.classpath
> ----------------------
> <paths>
>    <entry src="C:/bla/bla/test.jar" type="jar" />
>    <entry src="C:/bla/bla/bin" type="folder" />
>    <entry src="C:/bla/blo/bin" type="folder" />
> </paths>
> this could help you.
> It is very easy for IDEs to provide something like this.
> Tom

More information about the openjfx-dev mailing list