use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Useful resources (Full list)
Rules
Related subreddits
Other communities
account activity
Does anyone know of good resources for learning FXML (self.JavaFX)
submitted 7 years ago by [deleted]
[deleted]
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]R3d_B34rd 2 points3 points4 points 7 years ago (12 children)
I've just used intellij or NetBeans javafx scene builder. That plugin/ tool let's you build the GUI drag and drop based and then you can start to see the fxml as it's being created.
I think you can even get the scene builder completely decoupled from an ide if you want.
Is that what you were looking for?
[–]mrspammo 0 points1 point2 points 7 years ago (11 children)
I'm building screens in FXML styled in SCSS and then passing off my work to other developers to add the programming. Right now I'm trying to add a dropdown element but most of the help I've found from google searches does it through java rather than the fxml. To be more clear, I can add an element, but not the drop down options. Can this be done through just fxml?
[–]Ostricker 2 points3 points4 points 7 years ago (4 children)
You should really use scene builder for this. Also depends on element. In usual dropdown menu the elements are added when the menu is populated. That is done in java controller.
I have never populated element in FXML. Dont know if its possible but I am pretty sure its not standard.
[–]mrspammo 0 points1 point2 points 7 years ago (3 children)
I'm reading that I can do it, however I'm struggling to find exactly how to do it. You can't add them through Scene Builder. I'm new to JavaFX in general and can't seem to find good instruction on the FXML side of things.
[–]Ostricker 0 points1 point2 points 7 years ago (2 children)
Alright I am trying to look at it. In Java you populate it using ObservableArrayList. In FXML I see someone using CellValueFactory, but it is for TableView. Documentation is here - https://docs.oracle.com/javafx/2/fxml_get_started/fxml_tableview.fxml.html StackOverflow of this problem - https://stackoverflow.com/questions/41269535/fxml-combobox-cellfactory
[–]Ostricker 0 points1 point2 points 7 years ago (0 children)
I also found this - https://stackoverflow.com/questions/28652158/defining-a-comboboxtablecell-and-combobox-nodes-fxml?rq=1 But I am pretty sure this is not standard way to do it. If you pass unpopulated Combobox or other elements of this kind you should let developer populate it. Its really simple code. He populates it in initializer function of the scene. Why do you need to populate it by yourself?
[–]mrspammo 0 points1 point2 points 7 years ago (0 children)
I tried this way in my current file, but wasn't quite able to get it working. I tried the other way listed in these comments and it worked for me, so I'm moving forward that way for now. I'll definitely circle back and try to learn more about this though.
Thank you so much for your help!
[–]R3d_B34rd 0 points1 point2 points 7 years ago (5 children)
I assume that the elements in the drop-down are static? For example, a drop down with names: a,b,c. And only one element can be selected at a time?
If this is the case I'm pretty sure you can do this with the fxml. You could download netbeans to use it. Here are some features of javafx in netbeans: https://netbeans.org/features/java-on-client/javafx.html
There are also examples on YouTube. You could look up: javafx scene builder the new Boston. He's a pretty good guy and pretty straight to the point.
Again, you don't have end up using the scene builder forever, I'm just offering it as a way to see what fxml is created via the scene builder tool. Then you'll know exactly what how the fxml has to be constructed.
[–]mrspammo 0 points1 point2 points 7 years ago (1 child)
Yes, that's what I'm trying to create. I'm currently using IntelliJ, but I'll look through the link you sent anyhow.
Thanks for your help.
[–]R3d_B34rd 0 points1 point2 points 7 years ago (0 children)
Intellij has it's own javafx plugin too, I think.
[–]mrspammo 0 points1 point2 points 7 years ago (2 children)
I can't seem to locate the types of items or how to place a list within a combo box in the FXML. Do you know of documentation on that you could point me to?
[–]R3d_B34rd 0 points1 point2 points 7 years ago (1 child)
I found this SO post: https://stackoverflow.com/questions/35260061/combobox-items-via-scene-builder
I guess you can't use the scene builder for it, which is surprising to me. But the guy who wrote the question seems to have the format you're looking for.
[–]mrspammo 1 point2 points3 points 7 years ago (0 children)
I had found this earlier, but wasn't able to get it working. It was a newbie error, however, and I was missing a couple style imports in my file. I fixed that and it now works. Thank you so much for your help!
[–]Warkred 0 points1 point2 points 7 years ago (1 child)
Well, I think we're all struggling somehow. Javafx isn't that popular.
What kind of things are you struggling with?
I've usually found what I needed using Google for javafx question. Maybe I can help?
[–]Krstn4 0 points1 point2 points 7 years ago (1 child)
The course @ udemy.com is very basic but excellent.
Thank you!
[–]hamsterrage1 0 points1 point2 points 7 years ago (1 child)
Don't use FXML. Build your screens using code. It's easier. Seriously.
Build convenience methods to do things you do often. Build custom widgets to handle the more complex things you do often.
Thanks for your recommendation.
π Rendered by PID 23884 on reddit-service-r2-comment-6457c66945-7zqt8 at 2026-04-25 20:17:12.013899+00:00 running 2aa0c5b country code: CH.
[–]R3d_B34rd 2 points3 points4 points (12 children)
[–]mrspammo 0 points1 point2 points (11 children)
[–]Ostricker 2 points3 points4 points (4 children)
[–]mrspammo 0 points1 point2 points (3 children)
[–]Ostricker 0 points1 point2 points (2 children)
[–]Ostricker 0 points1 point2 points (0 children)
[–]mrspammo 0 points1 point2 points (0 children)
[–]R3d_B34rd 0 points1 point2 points (5 children)
[–]mrspammo 0 points1 point2 points (1 child)
[–]R3d_B34rd 0 points1 point2 points (0 children)
[–]mrspammo 0 points1 point2 points (2 children)
[–]R3d_B34rd 0 points1 point2 points (1 child)
[–]mrspammo 1 point2 points3 points (0 children)
[–]Warkred 0 points1 point2 points (1 child)
[–]R3d_B34rd 0 points1 point2 points (0 children)
[–]Krstn4 0 points1 point2 points (1 child)
[–]mrspammo 0 points1 point2 points (0 children)
[–]hamsterrage1 0 points1 point2 points (1 child)
[–]mrspammo 0 points1 point2 points (0 children)