Why would scenebuilder 2.0 fail to open my fxml file?
Asked Answered
P

7

34

I have an fxml file that I created using SceneBuilder 2.0. This file is used in my JavaFx project that I am developing using Netbeans 8. Today, SceneBuilder stopped working with my file. When I tried to open it, SceneBuilder would minimize and would not open the file. I don't have any custom components in my scene graph.

I copied the contents of the file into a new fxml file and gave it a new name. SceneBuilder was then able to open this file even though the contents are identical to the file that it is unable to open.

What is going on here?

my apologies, but I am unable to post the contents of the fxml file.

Pleasance answered 3/7, 2014 at 0:42 Comment(4)
The only thing, considering the behavior described is probably a weird char code that it couldn't handle properly.Barling
It takes time to respond wait for it it will definitely work.Gratt
maybe, because you opened another fxml document with same name !Chiro
Try to run the application! the retryChiro
H
113

Okay.. so here I am searching for the solution for this weird problem! Seeing none of the other answers working for me, I did the random most thing I could think of and it worked.

Open SceneBuilder (a brand new one). Go to File > Open Recent > Clear Menu. Close Scene Builder.

Now the bug should be fixed (it did for me)

PS: I am ashamed of posting this answer. But since this is a nasty bug which wasted time, I don't want anyone else to waste theirs'.

PPS: Also, I can't double-check this solution, since it worked for me and I can't recreate the buggy scenario anymore.

Hubble answered 3/10, 2014 at 19:55 Comment(0)
B
5

I solved this problem by alt-tabbing to the SB program, then maximizing the window (shortcut: window key + up arrow key).

Seems to be a SB bug.

Blunt answered 26/10, 2014 at 6:31 Comment(0)
J
3

I had the same problem. looks like it is a bug.

I have solved it by Creating a new FXML file (Empty) and copied all the code of original FXML file to it . The new FXML opened by SceneBuilder.

Jocelynjocelyne answered 13/7, 2014 at 12:56 Comment(0)
J
2

Also had this issue with Win 7. Trick is to right click the SB task bar icon, maximize the window, drag it down by the title bar and a real tiny window should show up, re-size the window and that should do it. I think it's an SB display bug. Good luck.

Jacky answered 15/8, 2014 at 19:24 Comment(2)
Thaks very much, but to do the right click you dont do it on the taskbar icon itself, you just hover the mouse on the icon, then click on the panel that shows up with the right button and then maximize it.Buckman
I would like to verify this answer, I wonder why OP hasn't accepted this answer. I had the same problem and this trick seems to correct it. All I did is to copy the project created on Windows to Ubuntu. Open FXML there in Linux Scene Builder, make some changes and then copy back to Window, bamm Windows based Scene builder wouldn't open it now, just some invisible window. And now open correctly each time. Some sort of weird display bug, or maybe Linux scene builder added some character which windows based scene builder didn't like at all.Marozas
L
1

Spent about 4 hours and this is how I solved it. In my FXML document, I had a FlowPane with a </child> tag. I changed it to <child></child> and it worked. SceneBuilder opened the FXML document. I know this is silly, and I can't explain why this happens, but I can reproduce it.

Latrena answered 23/5, 2016 at 3:31 Comment(0)
J
1

For me the problem was with the path of the image i was giving in the FXML file. i was able to solve the issue by using @ followed by image path. With this syntax error you will be able to run your application, but the scene builder will refuse to open the file.

for eg(assuming that you are providing relative path):

Wrong syntax:

               <ImageView fitHeight="31.0" fitWidth="40.0" pickOnBounds="true" preserveRatio="true" >
                   <image>
                       <Image url="img/image.png"></Image>
                   </image>
               </ImageView>

Correct syntax:

               <ImageView fitHeight="31.0" fitWidth="40.0" pickOnBounds="true" preserveRatio="true" >
                   <image>
                       <Image url="@/img/1000px-evobus.svg1.png"></Image>
                   </image>
               </ImageView>
Jelly answered 13/9, 2018 at 14:27 Comment(0)
C
0

In NetBeans go to Tools; Options;Java; JavaFX and set the path to the Scene Builder Home. That should fix the problem

Councillor answered 15/9, 2015 at 15:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.