Java Screen Full Size fullScreen()

Here you can find the source of fullScreen()

Description

full Screen

License

Apache License

Declaration

public static void fullScreen() 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.awt.*;
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;

public class Main {

    public static void fullScreen() {
        Robot robot = null;//w ww .  j av  a  2  s.co  m
        try {
            robot = new Robot();
        } catch (AWTException e) {
            e.printStackTrace();
        }
        robot.setAutoDelay(80);
        robot.mouseMove(500, 500);
        robot.mousePress(InputEvent.BUTTON1_MASK);
        robot.mouseRelease(InputEvent.BUTTON1_MASK);

        robot.keyPress(KeyEvent.VK_F11);
        robot.keyRelease(KeyEvent.VK_F11);
        try {
            Thread.sleep(5000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}

Related

  1. factorScreenDimension(Window window, double widthFactor, double heightFactor)
  2. fitInScreen(Component comp)
  3. fitInScreen(Window o)
  4. fitToScreen(Dimension size, GraphicsConfiguration screen)
  5. forceToScreen(Window window)
  6. fullScreen(Component component)
  7. fullScreen(Window window)
  8. getOppositeFullScreenBoundsFor(Rectangle r, boolean includeReservedInsets)
  9. initializeScreenArea(int priority)