Forums Register Login

How to interect between two JVM instances?

+Pie Number of slices to send: Send
Hello to all ranchers,

My desktop application is a JFrame and I want only one instance of my application to run at a time and so far i have been successful.

I used file locking mechanism to check if the lock on the file exists and it it does exists then I am stopping another instance of JFrame to load.

But when I minimize the first instance i want that first instance of JFrame to be maximized or you can say setVisible(true).

Does any one have any idea how can i do this?

Thanks
+Pie Number of slices to send: Send
Instead of using a lock you could have them communicate using Sockets.
You can start the first one as a Server on a fixed port, and a second will not be able to start on that port until the first one dies. You can have these processes communicate via this port as well.
I don't even know how to spell CIA. But this tiny ad does:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 753 times.
Similar Threads
My JFrame class causes exception
how to use JScrollBar in JFrame..Please Help Me
Context in server
java.io.RandomAccessFile. (Urgent please)
how to prevent multiple instance of jframe
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 06:19:20.