Full-screen java application minimizes the time when the screen saver turns on

I have an application that sets a full-screen frame, but seems to minimize when the screen saver turns on. I want this application to be the only application that touchscreen kiosk users can use, so this is a problem. Is there any way to prevent this?

+3
source share
3 answers

Another way is to add a window listener and a reset state when it is deactivated:

        frame.addWindowListener(new WindowAdapter() {
            @Override
            public void windowDeactivated(WindowEvent e) {
                frame.setExtendedState(JFrame.MAXIMIZED_BOTH);
                // or go to fullscreen mode here
            }
        });

But disabling the screen saver may be best for a start.

+1
source

, - - :

import java.awt.Robot;
public void disableScreenSaver() throws AWTException {
  Robot r = new Robot();
  r.waitForIdle();
  r.keyPress(KeyEvent.VK_CONTROL);
  r.keyRelease(KeyEvent.VK_CONTROL);
}

(, thread.sleep();). , .

, , - , -, :)

+2

( !), , :

API Win32 Java

/ Windows #/. Net

, Windows, :)

+1

All Articles