Using JavaFX with jPCT

Started by fluzz, August 14, 2016, 08:50:19 PM

Previous topic - Next topic

fluzz

I found an article for using swing with jPCT on the wiki (http://www.jpct.net/wiki/index.php?title=Using_jPCT_in_Swing), but I want to use JavaFX. Any suggestions or things I need to know?

EgonOlsen

No idea. You would need to make JavaFX and LWJGL work together. It's not really a jPCT thing.

fluzz

Would you recommend that I use swing then? I just wanted to use JavaFX because swing might get deprecated soon (it still works for now). There have been no improvements to swing, and Oracle mostly supports JavaFX. I'm worried that some of my projects would not work in the future...

EgonOlsen

Swing is the base of most business applications that aren't using a web client. Abandoning it would mean to abandon all these applications. I'm very sure that this won't happen, so I see no problem with using Swing.
Why do you need a GUI library anyway? I'm just asking, because Sinne people wanted to use GUI libraries to create a GUI on top of the GL rendering and I don't think that this is a very good idea.

fluzz

I was planning to make a game. I need the main menu and all that stuff, and correct me if I'm wrong, but doesn't swing create standalone desktop applications as well?

I still haven't figured out how to make the HUD yet. Maybe swing could do that? I'm open to suggestions. Thanks!

EgonOlsen

If it's supposed to be a game, I would always go with pure GL and leave Swing and similar GUI libraries aside. The simplest way to create a GUI with jPCT is to blit textures. A slightly more advanced way is to make yourself a simple GUI lib that uses texture blits in the background. You might want to look at http://www.jpct.net/wiki/index.php?title=Open_sourced_projects_from_Thomas, which includes some GUI stuff. It's for jPCT-AE, but the GUI related parts shouldn't be too hard to port.

fluzz

But how would I deploy it as a desktop application? I don't need swing for much except deployment. :-\

EgonOlsen

I'm not sure what using Swing has to do with deploying the application!? Can you explain that in more detail?

fluzz

Ok, never mind. Sorry; I don't even remember where I saw that.  ;D No idea what I was talking about.