I have a program and I want that if the user clicks on a "open new instance" button, the whole program will open again.
I tried that:
WelcomeFrame.main(new String[0]);
(while WelcomeFrame is the first jFrame of the program).
But while I try to access a static parameter from the two instances of the running program I see that this parameter is the same (and I must have two insatnces of that parameter).
How can I implement that in JAVA?
You can look into impmeneting a thread. I think it can solve your problem here. https://docs.oracle.com/javase/tutorial/essential/concurrency/runthread.html
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.