Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.awt.Frame;

public class Main {
    public static void main(String[] argv) throws Exception {
        Frame frame = new Frame();

        frame.setSize(300, 300);
        frame.setVisible(true);

        maximize(frame);

    }

    public static void maximize(Frame frame) {
        int state = frame.getExtendedState();

        // Set the maximized bits
        state |= Frame.MAXIMIZED_BOTH;

        // Maximize the frame
        frame.setExtendedState(state);
    }
}