LWJGL + Swing for my robots?

Started by i-make-robots, April 07, 2014, 00:14:58

Previous topic - Next topic

i-make-robots

Hi!

I'm working on a program to simulate the movment of my robots in OpenGL so that they can be programmed offline.  



https://www.youtube.com/watch?v=ObzyILAJFGQ

http://www.marginallyclever.com/shop/robot-arms/palletizing-robot-1

I've got the visuals and the inputs all working fine.  Now I want to connect through to the real robot with RXTX and I've hit a bit of a snag.  I need menus, and that means I need a GUI beyond OpenGL.

It seems I can choose between swing (which kills LWJGL Mouse), add a GUI library like TWL (which I tried and gave up on) or roll my own (not enough time).

Is there a way to get LWJGL and swing to play nicely together?  I only want mouse movement and buttons to be "heard" when the cursor is on top of the Display/canvas.

Maybe LWJGL is the wrong direction to go?  If so I'd love some advice on the right way to set up an opengl window.  I'd like to extend this system later to support my other robots, as well.

Thanks!

quew8

It is very possible but I've always found it to be error prone and extremely annoying to program. My advise would be to have two different windows running in the same application. One LWJGL, one Swing (or JavaFX, awt, whatever you want to use). You can have one of them running on a different thread and queue events between them. That's how have done it in the past and I've found it to be much easier than worrying about all the windowing and GUI problems.