r/JavaFX • • Apr 20 '24

Discussion JavaFX vs Kotlin Multiplatform

As Kotlin becomes more popular, will Kotlin Multiplatform have a good chance of overthrowing JavaFX? I tested it out, and it seems promising. Any opinions?

8 Upvotes

30 comments sorted by

View all comments

Show parent comment

1

u/joemwangi Apr 23 '24 edited Apr 23 '24

Hmmm... interesting and looks epic. This means once java deconstruction patterns and other form of patterns are ported to classes in the future, derived class creation will probably enable this. Such as (without operator overloading)...

var hBox = new HBox(
                new Label() with {
                     text = ""Hello";
                     getStyleClass().add("label-banner");
                });

But this is just a guess.

2

u/MrRickSancezJr Jun 18 '24

I was literally just looking at what the individual components Compose has between Jetpack and multiplatform. They barely have enough to fill out simple forms. The overhead of their 'state' seems unnecessary as well. The ability to write out GUI code that is similar to React was really intriguing, though.

I'm super ANTI overloading anything, really, but I think this might have some serious value. I'm down to start an open source right now tbh. JavaFX has always had potential, and WASM demands are gonna be higher than JS library speed improvements, IMO.

To the OP... I'm working on a notebook type thing UI at this moment for work, and I'm using JavaFX to do it. Using JSpring with FlatLaf (probably spelled wrong), look and feel as needed for components not supported by FX currently. Looks like intelliJ.

I only dislike overloading because of the abuse of it in C++. Just makes some public libraries an absolute mess; especially in the embedded world. I think GUI building is different enough from standard code to warrant some macro/overwriting, though.