Jump to content
ChetanaSforum
vineelaralla@hotmail.com

How to prevent Multiple Instances of a program?

Recommended Posts

Hii everyone,Please do replyWhen iam running a swing application in net beans multiple times,iam getting multiple instances of that app,What to do to get only one instance of that app even though i run the same app multiple times without closing the o/p window.Awaiting for anyones help.. Thankyou

Share this post


Link to post
Share on other sites

Hii everyone,Please do replyWhen iam running a swing application in net beans multiple times,iam getting multiple instances of that app,What to do to get only one instance of that app even though i run the same app multiple times without closing the o/p window.Awaiting for anyones help.. Thankyou

i think a single ton class would help you!!!!!it leads ur applicatin eligible 4 generating a single instance!@!!!!(i am not a xpert at swings( i am a fresher),, i hav only core java knowledge,, ignore if it does nt work, but tell me right way if u found it)

Share this post


Link to post
Share on other sites

i think a single ton class would help you!!!!!it leads ur applicatin eligible 4 generating a single instance!@!!!!(i am not a xpert at swings( i am a fresher),, i hav only core java knowledge,, ignore if it does nt work, but tell me right way if u found it)

Hello,Thanks for the reply..if we run singleton class in different virtual machine,then each vm will have one own instance...will give a try and will post here if i found any solution..

Share this post


Link to post
Share on other sites

There are many ways:... I would suggest you try withhave an "instance file" in /var/run or similar (cross-platform)use a fixed socket (cross-platform)use DBus to register a name (linux)

Share this post


Link to post
Share on other sites

You might have some issues with NetBeans bundled appserver config parameters or your ant script files.Try using one of the samples that comes with Netbeans and see if you get the same error. If you do the easiest way to sort things out would probably be NetBeans reinstall.Sometimes also because of the server socket .The actual work of the server socket is performed by an instance of the SocketImpl class.

Share this post


Link to post
Share on other sites

You may have some problems with NetBeans packages files.Try configure the application server or ant script with one of the samples that come with Netbeans and see if you have the same error. If you the easiest way to work things probably would have NetBeans reinstall.Sometimes as a socket server. Real-performance server socket running an instance of SocketImpl.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×