Use the JFrame for simple JPanel befaure the 3d enviroment

Hello have been working a little bit with the engine but i do have one some difficulty. I did hear about Nifty Gui to put panel in front of everything but i was wondering if i could not simply access the JFrame to switch between the 3D environment (or the default view when you launch a simple application) and the JPanel am using to deal with the connection.

My application is supposed to deal with the connection of the player then let im select a world then put im in the 3d environment with is character. So the 3D should only be load once every step of the connection is done and i don’t want to launch a new JFrame cause this would not be really professional.

Any suggestion?

Simply spoken no,
jme does not use a jframe.

Complex spoken,
there (in the examples) is a way that copies the frame into a bufferdimage for further use in swing. This reduces performance, and should be tested if its good enough.

1 Like

So i should use Nitfy gui? Cause so far it seem like the only one who can deal whit that kinda thing.

My panel are not realy elaborate anyway, it was more a test whit the database connectione then anything else so if it have to be restart from crap its okay, i just want to make sure what is the more appropriate for a connection panel.

Nifty gui is one choice,

then there are at least these 3 I know about: (search forums for keyword)
Lemur
ToneGodUi
JME3-JFX

I suggest to read about eachs cons and pros, and maybee test them out if they fit your programming style with a simple example.

1 Like

Thank you very much, il check them.

Many people want to use swing because theres visual editors for it and think they get results more quickly. They disregard the fact that swing runs on its own thread and that they have to manage the threading between swing and jme which makes the combination MUCH more complicated and only results in pain in the end.

I don’t use any editors, most of my component are homemade and place with an null layout. But i pretty new to all of this, and i somehow thought that the frame used in JME was simply an extends of JFrame and i could get out the 3d environment for the time i don’t need it, and then put in back in place. Not any real advantage real, as my connection page pretty much don’t use any resource but still something good to know.
But o well i was wrong, but this make me wondering : is swing good for anything except test? Cause the way your talking about it,swing don’t seem to be of any use at all for professional level.

@SimonBedard said: I don't use any editors, most of my component are homemade and place with an null layout. But i pretty new to all of this, and i somehow thought that the frame used in JME was simply an extends of JFrame and i could get out the 3d environment for the time i don't need it, and then put in back in place. Not any real advantage real, as my connection page pretty much don't use any resource but still something good to know. But o well i was wrong, but this make me wondering : is swing good for anything except test? Cause the way your talking about it,swing don't seem to be of any use at all for professional level.

Swing is fine for a swing app. It’s a problem for a 3D app that already has its own rendering thread.

For your needs, any of the in-JME GUIs will work for you. Lemur may be the most ‘swing like’ because I come from a long Swing background. I know that it’s easy to plop some labels, buttons, and edit fields right on the screen. I can’t speak to the others as I’ve never tried them.

Well Javafx is also very swing like, especially in the regard, that the Jfx will run in a seperate thread. While giving you quite some power due to this, you must then also take care of multithreading correctness.

For the beginning I would depending on complexity either suggest lemur or tonegodui, if you only need static forms nifty is also a valid choice.