• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

How to edit a sub-main fx:include file in Scene Builder?

 
Ranch Hand
Posts: 234
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From Scene Builder 8.3.0 and the project's MainView.fxml, I added multiple sub-fxml files e.g. Tab1.fxml, Tab2.fxml ... using File->Include->FXML...
Whenever I wanted to edit the included sub-fxml files by right-clicking on the sub-fxml, then clicking on Edit Included FXML, Scene Builder throws this error message:

This file does not have an app associated with it for performing this action. Please install an app or, if one is already installed, create an association in the Default Apps Setting page.

To avoid this problem, I edit the sub-fxml files directly, the changes are reflected in the MainView.fxml.

I using e(fx)clipse on Windows 10.

 
Sheriff
Posts: 7108
184
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If seems this is a problem in Scene Builder.  I would

* Get the latest version.  The latest 8 version is 8.5 and there's an 11 version.
* report the problem here

https://github.com/gluonhq/scenebuilder/issues
 
AhFai Chan
Ranch Hand
Posts: 234
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, I have the same issues like most others who reported them e.g. Scene Builder crashing when scene graph gets more sophisticated.

I am editing the FXMLs directly and have been able to resolve most of the problems, including "floating" the nodes to edge when expanding the window size.

I think I am alright if I inject the stage with each new fx:include(...);
 
Rancher
Posts: 259
13
Eclipse IDE C++ Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is not a bug! it's simply because you didn't associate .fxml files with scenebuilder in windows. you have to make it your default program for opening that file type.
also, if you're using java11 you should upgrade to the scenebuilder11, the version 8 scenebuilders are for java8.

i can tell you though of a real bug that i found. if you try to do an include and it repeatedly fails, make sure that your root is an anchorpane. for some reason scenebuilder doesn't allow vbox or hbox, and there's no warning message either, the include just fails with no reason given. very annoying.
 
Knute Snortum
Sheriff
Posts: 7108
184
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmm...  Still doesn't work for me even if I associate FXML files with Scene Builder.
 
S Fox
Rancher
Posts: 259
13
Eclipse IDE C++ Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i'm using windows7 x64, so maybe the problem is only with windows10. once i associated .fxml to open with scenebuilder it worked fine. the exe to associate fxml with on win7 is:
C:\Users\YourUserName\AppData\Local\SceneBuilder\SceneBuilder.exe
 
AhFai Chan
Ranch Hand
Posts: 234
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Knute Snortum wrote:Hmm...  Still doesn't work for me even if I associate FXML files with Scene Builder.




I suggest manually editing the fxml-scripts.

If I use Scene Builder 8.5.0 on Windows 10 and e(fx)clipse, I get spurious error messages like:
* no injectable fields found even though FXMLLoader can parse and match the @FXML fields in the controller to the corresponding fxml-script;
* cannot fx:include scene, have never been able to do that, so I just insert the codes into the fxml-script, works fine like that;

Also, every once so often, Scene Builder crashes and I have to use Windows' End Task to crash out of it. Save often, use ctrl-s.
Mostly, I just use it to get a visual feedback, which is nice to have.

I still have a lot of unanswered questions, like how to load a scene onto the inner BoderPane center (TabPane in BorderPane in BorderPane) and why I can load table with data onto Scene using MenuItem, but not with an @FXML-Button with matching @FXML btnButtonOn method.

Maybe Swing wasn't that bad after all...



 
AhFai Chan
Ranch Hand
Posts: 234
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

S Fox wrote:i'm using windows7 x64, so maybe the problem is only with windows10. once i associated .fxml to open with scenebuilder it worked fine. the exe to associate fxml with on win7 is:
C:\Users\YourUserName\AppData\Local\SceneBuilder\SceneBuilder.exe



Yes, Windows 10 has a lot of problems, going by the repeated updates and the social media traffic about it.
But most companies use Windows 10.
 
AhFai Chan
Ranch Hand
Posts: 234
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

S Fox wrote:this is not a bug! it's simply because you didn't associate .fxml files with scenebuilder in windows. you have to make it your default program for opening that file type.
also, if you're using java11 you should upgrade to the scenebuilder11, the version 8 scenebuilders are for java8.

i can tell you though of a real bug that i found. if you try to do an include and it repeatedly fails, make sure that your root is an anchorpane. for some reason scenebuilder doesn't allow vbox or hbox, and there's no warning message either, the include just fails with no reason given. very annoying.



I have created scenes with VBox root and loaded that onto the rootNode, like BorderPane or TabPane, so it works.
 
Knute Snortum
Sheriff
Posts: 7108
184
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

AhFai Chan wrote:If I use Scene Builder 8.5.0 on Windows 10 and e(fx)clipse, I get spurious error messages like:
* no injectable fields found even though FXMLLoader can parse and match the @FXML fields in the controller to the corresponding fxml-script;


Do you have an example?

* cannot fx:include scene, have never been able to do that, so I just insert the codes into the fxml-script, works fine like that;


I was able to do this by manually editing the FXML file.  That didn't work for you?

I still have a lot of unanswered questions...


Why not post them as new threads?
 
S Fox
Rancher
Posts: 259
13
Eclipse IDE C++ Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
as i said earlier, there's a bug in scenebuilder where it prevents you from doing fx:include if your topmost root node isn't some kind of pane. it definitely works with anchorpane if you want to try that, just make a very simple scene consisting only of anchorpane then try to do an include on it. i don't think the fxml that is to be included needs to have it's root as a pane too, but if you still have trouble try wrapping that one too.
 
Knute Snortum
Sheriff
Posts: 7108
184
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

S Fox wrote: i don't think the fxml that is to be included needs to have it's root as a pane too,...


That's correct.  It can be as simple as a button.
 
Their achilles heel is the noogie! Give them noogies tiny ad!
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic