Java JFrame maxamiseWindow(JFrame window)

Here you can find the source of maxamiseWindow(JFrame window)

Description

Attempts to maxamise the given JFrame

License

Open Source License

Parameter

Parameter Description
window a parameter

Declaration

public static void maxamiseWindow(JFrame window) 

Method Source Code

//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");
        }
    }
}

Related

  1. loadImageToFrame(JFrame frame, BufferedImage image)
  2. locateForm(JFrame f, int x, int y, int w, int h)
  3. makeFullScreen(JFrame frame)
  4. makeShaped(final JFrame frame)
  5. makeTrans(JFrame frmDisks, float f)
  6. maximizeJFrame(JFrame f)
  7. maximizeWindow(JFrame window)
  8. maxIt(JFrame jFrame)
  9. messageDialog(String string, JFrame parentFrame)