Here you can find the source of maxamiseWindow(JFrame window)
Parameter | Description |
---|---|
window | a parameter |
public static void maxamiseWindow(JFrame window)
//package com.java2s; /*// w w w . j a va 2 s. co m * JFrameUtils.java * Copyright (C) 2011 Steven West, University of Kent <sw349@kent.ac.uk> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ import javax.swing.*; public class Main { /** * Attempts to maxamise the given JFrame * @param window */ public static void maxamiseWindow(JFrame window) { //Check to see if the window can be maximised. if (java.awt.Toolkit.getDefaultToolkit().isFrameStateSupported( JFrame.MAXIMIZED_BOTH)) { //Make the window maximized window.setExtendedState(JFrame.MAXIMIZED_BOTH); } else { System.out.println("Unable to maximise the window"); } } }