Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » e(fx)clipse » error in Create New FXML Document wizard ?
error in Create New FXML Document wizard ? [message #1422598] Sat, 13 September 2014 03:54 Go to next message
ops incybr is currently offline ops incybrFriend
Messages: 5
Registered: April 2014
Junior Member
The create a new FXML document wizard allows one to choose a scene as a root element. The generated file throws a "root cannot be null" error when attempting to open the document in SceneBuilder. Apparently, according to the docs, a scene absolutely requires a root element but cannot itself be a root element.

Eclipse v4.4.0, e(fx) v1.0.0.201408150702
Re: error in Create New FXML Document wizard ? [message #1422729 is a reply to message #1422598] Sat, 13 September 2014 09:08 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
This is *NOT* a bug in e(fx)clipse but SceneBuilder! The following
FXML-File and JavaCode are perfectly ok and expected to work

<?xml version="1.0" encoding="UTF-8"?>

<?import javafx.scene.Scene?>
<?import javafx.scene.layout.BorderPane?>
<?import javafx.scene.control.Button?>

<Scene xmlns:fx="http://javafx.com/fxml/1">
<root>
<BorderPane >
<center>
<Button text="Hello World!!!"></Button>
</center>
</BorderPane>
</root>
</Scene>

> package application;
>
> import javafx.application.Application;
> import javafx.fxml.FXMLLoader;
> import javafx.scene.Scene;
> import javafx.stage.Stage;
>
>
> public class Main extends Application {
> @Override
> public void start(Stage primaryStage) {
> try {
> Scene scene = (Scene)FXMLLoader.load(getClass().getResource("Sample.fxml"));
> scene.getStylesheets().add(getClass().getResource("application.css").toExternalForm());
> primaryStage.setScene(scene);
> primaryStage.show();
> } catch(Exception e) {
> e.printStackTrace();
> }
> }
>
> public static void main(String[] args) {
> launch(args);
> }
> }

So please report this as a bug against SceneBuilder.

Tom

On 13.09.14 05:54, ops incybr wrote:
> The create a new FXML document wizard allows one to choose a scene as a
> root element. The generated file throws a "root cannot be null" error
> when attempting to open the document in SceneBuilder. Apparently,
> according to the docs, a scene absolutely requires a root element but
> cannot itself be a root element.
>
> Eclipse v4.4.0, e(fx) v1.0.0.201408150702
Re: error in Create New FXML Document wizard ? [message #1423136 is a reply to message #1422729] Sun, 14 September 2014 00:30 Go to previous message
ops incybr is currently offline ops incybrFriend
Messages: 5
Registered: April 2014
Junior Member
Thank you for the advisory. Rather than have an inexperienced non-professional newbie inform Oracle of a new feature in SceneBuilder this hobbyist will simply avoid SceneBuilder and FMXL as a bug ridden pre-alpha disease.
Previous Topic:ExtendedFXMLLoader cannot be resolved
Next Topic:How to run unit tests in an e4 + e(fx)clipse project?
Goto Forum:
  


Current Time: Sat Apr 27 05:19:20 GMT 2024

Powered by FUDForum. Page generated in 0.02499 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top