How can I always keep my app in full screen without being minimized?

Asked

Viewed 211 times

5

I am developing an application in Java that should stay in full screen and can not be minimized or give space to another application or even the OS, in a way blocking everything and leaving only it on the screen, but I’m having difficulties.

I can leave in full screen but if I use Alt + Tab, it minimizes.

How do I get this behavior?

  • It’s called Kiosk mode. You have some related questions here at SOPT (in other languages), for example: http://answall.com/questions/143006/comorblockr-o-computador-via-c%C3%b3digo/143028#143028

  • I don’t know what the intention is with this Thiago, if it’s something academic or a particular client’s rule all right, but if it’s not one of these two cases should consider adding this option in the configuration (maybe you’ll already do it) for the user to be able to do whatever he wants inside his computer, because limiting the user within his system does not seem to me a good idea. But I’ll be here waiting for the answer because I intend to use it in a system I’m working on...

  • http://stackoverflow.com/questions/6127709/remove-the-possibility-of-using-alt-f4-and-alt-tab-in-java-gui/6128105#6128105

  • This wouldn’t be horrible for the user experience!?

1 answer

-3

To block the Alt+Tab you can use a more aggressive way:

public class AltTabStopper implements Runnable
{
     private boolean working = true;
     private JFrame frame;

     public AltTabStopper(JFrame frame)
     {
          this.frame = frame;
     }

     public void stop()
     {
          working = false;
     }

     public static AltTabStopper create(JFrame frame)
     {
         AltTabStopper stopper = new AltTabStopper(frame);
         new Thread(stopper, "Alt-Tab Stopper").start();
         return stopper;
     }

     public void run()
     {
         try
         {
             Robot robot = new Robot();
             while (working)
             {
                  robot.keyRelease(KeyEvent.VK_ALT);
                  robot.keyRelease(KeyEvent.VK_TAB);
                  frame.requestFocus();
                  try { Thread.sleep(10); } catch(Exception) {}
             }
         } catch (Exception e) { e.printStackTrace(); System.exit(-1); }
     }
}

I understand you want this.

  • Not quite what the OP wanted, was to keep the application in full screen, even alternating window. This ai does not solve the problem, it is more complex.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.