Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot open FXML in SB after adding margin property to a custom control #44

Open
gluon-bot opened this issue Nov 30, 2015 · 4 comments
Open
Labels
bug Something isn't working custom control Custom controls usage in Scene Builder minor

Comments

@gluon-bot
Copy link

Originally reported by: Haraldur Haraldsson (Bitbucket: haraldur, GitHub: haraldur)


If you add a margin to a custom control in Scene Builder (or FXML code) and then close it, the next time you try to open it, you get a LoadException:

"Could not open '*****.fxml' - Open operation has failed. Make sure that the chosen file is a valid FXML document."

To fix it you have to remove the "HBox.margin" property manually from the custom control in the FXML code.

NB. this error is only related to opening the file in Scene Builder, to build and run in java(fx) there are no issues.


@gluon-bot
Copy link
Author

Original comment by Andre Krause (Bitbucket: akrause, GitHub: akrause):


Can you please provide some more information on this? I couldn't really reproduce this error.

Maybe you can give us some example source code, for which the SB is not working properly. And what SB version did you used?

@gluon-bot
Copy link
Author

Original comment by Haraldur Haraldsson (Bitbucket: haraldur, GitHub: haraldur):


Sorry if I was not clear, if you add a custom component to a HBox or VBox and use the margin property, then the file will not open again. I have now tested this with my own custom controls and some JFXtras (e.g. SimpleMetroArcGauge).
I attached a new image with the FXML code to be clear :)
Tested with
Version 8.0.0
Date: 2015-03-06
Java Version: 1.8.0_40-b25

@gluon-bot
Copy link
Author

Original comment by Andre Krause (Bitbucket: akrause, GitHub: akrause):


So i reproduced this behaviour, but it seems that this is not a problem with the SceneBuilder. The fxml is loaded with a javafx function FXMLLoader.load(). The exception is thrown, because something failed in this function.

So the conclusion is, that this is a javafx bug. There is already a PR in the Java bugtracker, although it is with VBox.margin this should be the same behaviour.

https://bugs.openjdk.java.net/browse/JDK-8088008

@gluon-bot
Copy link
Author

Original comment by Eber Geiss (Bitbucket: Ebergeiss, GitHub: Unknown):


Hi Haraldur, I know I'm late. I got the same error. The creepy thing is that this Error does not appear everytime but once the Error appears you have to remove the margins in the sourcecode. The bad news: Sadly, that isn't a usable solution because your work is lost. The good news:** I got a new Solution**!

Just open the Scene Builder as a normal Programm and without *.fxml-File. The you press "file -> Open..." or "Ctrl + O" and load the file by hand.
It worked for me and I hope it will work for everyone with the same Issue.

King Regards
Ebergeiss

@gluon-bot gluon-bot added minor bug Something isn't working labels May 9, 2018
abhinayagarwal pushed a commit that referenced this issue May 9, 2018
#44)

SB-235: Fixed wrong i18n bundle and minor fixes

Approved-by: Joeri Sykora <[email protected]>
@AlmasB AlmasB added the custom control Custom controls usage in Scene Builder label Jan 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working custom control Custom controls usage in Scene Builder minor
Projects
None yet
Development

No branches or pull requests

2 participants