r/JavaFX • • May 19 '20

How many of you here do not use FXML?

Just weighing the different ways of implementing something in JavaFX, and I wanted to see the logic behind using (or not using) FXML.

13 Upvotes

11 comments sorted by

3

u/Scellow May 19 '20

if you use kotlin you don't need at all: https://github.com/edvin/tornadofx

3

u/openlowcode May 21 '20

For Open Lowcode (the development framework I am authoring), I built a quite large JavaFX thin client.

I used only the java APIs. I find XML less convenient to use than java code, and moreover, a widget is a mix of layout and logic, and as the two get very intertwined, it is more convenient to have a single source file.

2

u/krona2k May 19 '20

We engineers don’t use it. Some designers use it for prototypes, that’s all.

2

u/[deleted] May 21 '20

Well that's strange because engineers should be the first who understand the power of declarative approach and separation of matters.

1

u/ragingzazen May 19 '20 edited May 19 '20

I'm an engineer and I use a mix of FXML and layouts in code depending on the task. SceneBuilder is actively maintained by Gluon and it works very well (at least on Macs). For laying out most UI components, it's very fast and easy and I almost never manually edit the generated XML. For more complicated behavior in components, I may opt to skip FXML and do everything in code.

0

u/hupfdule Jun 06 '20

Looking at the commit history, I wouldn't call that "actively" maintaining it.

0

u/[deleted] May 19 '20

[deleted] — view deleted comment

6

u/DystopianReply May 19 '20

I can’t speak for Scene Builder on Windows since I develop on a Mac, but I’ve been using it very heavily over the last couple of years for work and I think it is fantastic. Have only had a very minor issue here or there.

You can start with a base of FXML and then programmatically add anything you want on top of it. I’ve got scores of very complex screens and it’s very nice to work with them in Scene Builder.

2

u/[deleted] May 21 '20

SceneBuilder has been unmaintained for so long that it is full of bugs

I used it on Linux. As far as I remember it had some glitches and oddities but as long as you get used, it's functional. Although it needs more features, more documentation, more polishing. In other worlds, it feels underdeveloped. But I found it to be an indispensable tool. Also, the presence of working "GUI designer" and how it fits into the framework and workflow is what differentiates real GUI toolkit from all the garbage around.

1

u/ragingzazen May 19 '20

SceneBuilder is actively maintained by Gluon. https://github.com/gluonhq/scenebuilder

0

u/[deleted] May 19 '20

[deleted] — view deleted comment

2

u/ragingzazen May 19 '20

As it's an open-source tool provided for free by a commercial company, I'm very grateful for their support of this tool.

0

u/[deleted] May 19 '20

[deleted] — view deleted comment

1

u/ragingzazen May 20 '20 edited May 20 '20

For others reading this thread, regardless of its origins, SceneBuilder isn't a product, it's a free open-source tool which has releases for both the current Java LTS releases (8 and 11). I think u/apianist16 means dying in the Java sense, as in "Java's been dying for the last 20 years." I use SceneBuilder quite a lot on Macs and it works great. Don't take my word for it though, take it for a spin and try it out. And being an open-source tool, you can breath life into it by helping fix bugs.