I have two Java swing applications (means running in two JVM). Is there any way to switch between them? Active another application’s window by Java code?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can try using JNA. I’ll give you some code for Windows (more or less will be for other systems) using Maven:
(sorry but I cannot get formatting right)
Create Maven project, and add dependencies:
Create interface
Create class
And invoke
Of course –
windowTitleis your window title (String) that you want to focus.