r/javahelp • • May 05 '22

Unsolved Creating a GUI in java

I’ve been out of the programming game for a while, when I was in college i made GUIs with JavaFX. I was wanting to start to make a game just for a hobby, but then I found out the newest JDK no longer supports JavaFX. Was there a better one introduced or did they fall back onto AWT?

19 Upvotes

20 comments sorted by

View all comments

14

u/dionthorn this.isAPro=false; this.helping=true; May 05 '22

They made it open source and decoupled it from the JDK

https://openjfx.io/

I have a few game projects using modern java and JFX maven will make it very easy to get it working.

https://github.com/dionthorn/LifeSimRPG

1

u/thisismyaccountsmile May 05 '22

But is that the best option? Like did the decouple it because it was out of date and shouldn’t be used?

5

u/dionthorn this.isAPro=false; this.helping=true; May 05 '22

It is updated to jdk 18 by openjfx you can scope out their GitHub.

https://github.com/openjdk/jfx

Best GUI is based on your needs. Just need a basic GUI use Swing/AWT, need a little more control use JFX want 3D use LWJGL

1

u/thisismyaccountsmile May 05 '22

Also is that something I can run from my cmd line? I used to use eMacs and just run things from cmd line, can I do that with that?

2

u/mk_gecko Intermediate Brewer May 05 '22

Yes.

I can write swing code from linux cmd line using vim and then compile and run it. I haven't tried it with the MigLayout library though.

You'll need Xwindows to run it though. This is built into Linux; for windows, get XMing.