Here you can find the source of fullScreen()
public static void fullScreen()
//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(); } } }