Possible duplicate: How to implement a single instance application in Java
There are two methods I know of for creating single instance app