Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Full Window when run the program.

  1. #1
    Junior Member
    Join Date
    Feb 2011
    Location
    Dhaka, Bangladesh
    Posts
    4
    My Mood
    Inspired
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question 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.

    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.


  2. #2
    Junior Member
    Join Date
    Feb 2011
    Location
    Dhaka, Bangladesh
    Posts
    4
    My Mood
    Inspired
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Full Window when run the program.

    Hi thanks.
    I googled and found it.

    I had to add simply the following code.

    p1.setExtendedState(MAXIMIZED_BOTH);

    Many many thanks

Similar Threads

  1. Is java a power full programming language? can java do this?
    By Jhovarie in forum Java Theory & Questions
    Replies: 5
    Last Post: March 2nd, 2011, 02:02 PM
  2. Craating non active window ,and inputing to the non active window.
    By java-beginner in forum Java Theory & Questions
    Replies: 0
    Last Post: February 25th, 2011, 10:13 PM
  3. how to get full path name from realtive path
    By priyanka3006 in forum File I/O & Other I/O Streams
    Replies: 8
    Last Post: August 10th, 2009, 04:28 AM