Here you can find the source of fullScreen(JFrame window)
public static void fullScreen(JFrame window)
//package com.java2s; import java.awt.Dimension; import java.awt.Toolkit; import javax.swing.JFrame; public class Main { public static void fullScreen(JFrame window) { Toolkit kit = Toolkit.getDefaultToolkit(); Dimension screenSize = kit.getScreenSize(); screenSize.width = screenSize.width * 2 / 3; screenSize.height = screenSize.height * 2 / 3; window.setMinimumSize(screenSize); window.setLocation(screenSize.width * 1 / 6, screenSize.height * 1 / 6); window.setExtendedState(javax.swing.JFrame.MAXIMIZED_BOTH); }//ww w .j a va 2 s. c o m }