Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JavaFX SceneBuilder 2.0 doesn't open FXML for custom components with fx:root as main layout tag

I have custom component with layout on FXML file which containts line

<fx:root type="javafx.scene.layout.VBox" spacing="10.0" xmlns:fx="http://javafx.com/fxml">

I create this file on SceneBuilder 1.0, but then i try open this file on SceneBuilder 2.0 i got Exception

java.io.IOException: javafx.fxml.LoadException: Root hasn't been set. Use method setRoot() before load.
/Users/dmitrynelepov/Development/SogazGit/smpb/SMProjectBrownRelease/SMPBProxy/engine/fxml/component_daemon_viewer.fxml:14

Also must to tell: in applications this fxml loadings fine with setting root by code.

In official tutorial (http://docs.oracle.com/javafx/2/fxml_get_started/custom_control.htm) tells:

<fx:root type="javafx.scene.layout.VBox" xmlns:fx="http://javafx.com/fxml">
    <TextField fx:id="textField"/>
    <Button text="Click Me" onAction="#doSomething"/>
</fx:root>

enter image description here

As u can see Oracle tells:Delete the AnchorPane markup that NetBeans IDE automatically generated.

But it's not working.

UPDATE

SceneBuilder 2.0 Build 7 - the problem persists

JDK8 b117 - the problem persists

Link JIRA: https://javafx-jira.kenai.com/browse/DTL-5968

like image 546
Dmitry Nelepov Avatar asked Nov 14 '13 08:11

Dmitry Nelepov


1 Answers

Thanks for SceneBuilder developers.

Bug with https://javafx-jira.kenai.com/browse/DTL-5968 has fixed.

And on SceneBuilder 2.0 build 9 - problem was solved.

Question closed.

like image 99
Dmitry Nelepov Avatar answered Sep 18 '22 16:09

Dmitry Nelepov