Swing to Application interaction – How?

I’ve put together a swing app with an Application canvas. This works like a charm. In order to exchange data between the swing "shell’ and the jME application, I’ve build a small socket server into the swing “shell”, and pump info from the jme application to the “shell” via tcp. This works fine for a prototype. However I now need to switch into a production environment and need a more direct means of communication. I’ve set up setters and getters in the jme application, and somehow need to get to these via the jme application class instance or context (no idea which word to use here, so don;t slam me).
Any help in this regard, or any suggestions of any other viable “direct” method of data interchange will be very much appreciated.

They are both in the same JVM?

I’m trying to figure out the best path to bring you back to earth because you are out past pluto somewhere with the “TCP” thing… unless I totally misunderstand something. Honestly, even in the worst case I can’t figure out why you didn’t just use a ConcurrentLinkedQueue command queue or something. The TCP thing makes me think they are in totally separate JVMs or something.

Why would you not just use Application.enqueue(Callable) to run things on the JME thread? Or if it’s going the other way SwingUtilities.invokeLater()… man, I just don’t understand something I think.

1 Like

Java is a far cry from the c++ I am used to, and my Java development has been mainly with corporate Swing applications. The need for Java thread communication was not required for my the stuff I did, since it was mostly database stuff, so for all intents and purposes it’s a black hole to me… But knowing tcp very well, it took a a few minutes to put a simple comms solution together (It did job, and I could carry on with the real development)

This explains why I orbited Pluto on my way to the supermarket. Anyway, now that I’ve saturated my mind with Java pipes and queues, I can put the pluto launcher to bed, and you can stop grinning at my noobness. Thanks for the sign posts, they certainly opened up new doors.

1 Like

Glad it helped. Sorry if I sounded rude or something but I really was having a hard time figuring out how to approach it. :slight_smile:

1 Like

No offense taken. I may yet ask questions about plankton while I’m visiting MACS0647-JD. :evil:

1 Like