Maximizes a JFrame, just like the 'maximize window' button does. - Java Swing

Java examples for Swing:JFrame

Description

Maximizes a JFrame, just like the 'maximize window' button does.

Demo Code


//package com.java2s;

import java.awt.Frame;

import javax.swing.JFrame;

public class Main {
    /**/*from  ww w. j  a  v a 2s  . c o  m*/
     * Maximizes a JFrame, just like the 'maximize window' button does.
     * <p>
     * @param f     The frame to maximize.
     */
    public static void maximizeJFrame(JFrame f) {
        f.setExtendedState(Frame.MAXIMIZED_BOTH);
    }
}

Related Tutorials