Full Window when run the program.
I want my program to open in full maximized mode while users run the program (like Firefox, Internet Explorer etc.). I hope you understood what I mean. Please help me to code this. Below is a simple code.
Code :
import javax.swing.*;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author Faysal
*/
public class Panel extends JFrame {
public Panel() {
super("Main Window Title");
}
public static void main(String args[]) {
Panel p1 = new Panel();
p1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
p1.setVisible(true);
p1.setResizable(true);
p1.setSize(400, 500);
// I think I should add something here. Please help.
}
}
Thanks in advance.
Re: Full Window when run the program.
Hi thanks.
I googled and found it.
I had to add simply the following code.
Code :
p1.setExtendedState(MAXIMIZED_BOTH);
Many many thanks