Run a jar without losing focus

I am using Windows Task Manager to run the .jar every 5 minutes. Its a simple JFrame, declared as public class myClock extends javax.swing.JFrame

, just shows the actual time (HH: MM).

I have 2 screens: main screen and secondary screen.

When the clock starts, it starts on the secondary screen in the corner. While watching a movie or playing in full screen mode on the home screen, if a task is running, everything on the home screen, when full screen mode is minimized, the clock is displayed on the secondary screen and focuses.

Is there a way:

  • Disable the JFrame from focusing on the watch, or
  • Lock the focus on the program I have chosen to avoid minimizing it.
+3


source to share


1 answer


Disable the JFrame from focusing on the watch, or

When creating a frame, you can use:



frame.setFocusableWindowState(false);

      

+3


source







All Articles