Stijn Vanpoucke
Stijn Vanpoucke

Reputation: 1425

How to write a Java application who doesn't get the focus?

Is it possible to write a Java application (Swing / JavaFX) who doesn't get the focus when launched? So that the application who had the focus before keeps it's focus?

Upvotes: 2

Views: 234

Answers (1)

AlexR
AlexR

Reputation: 115338

Yes, sure. First if you create Window (not frame or JFrame) it does not get focus by default. Second, just call f.setFocusableWindowState(false); on your frame and get the same behavior.

Upvotes: 6

Related Questions