Question

My First JFrame: Here i am just calling the second JFrame by using

new viewxmls().setVisible(true);

My Second Jframe (JFrame Name:viewxmls )

    public static void main(String args[]) 
     {

        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run()
            {
              //  new viewxmls().setVisible(true);
              viewxmls mv1=new viewxmls();
             //mv1.setBounds(200,50,133,122);
              mv1.pack();
             //mv1.setSize(1300,700);
            //mv1.setExtendedState(MAXIMIZED_BOTH);

             mv1.setVisible(true);
             mv1.setExtendedState(JFrame.MAXIMIZED_BOTH );

            }
         });

      }

When i call the second Jframe it becomes very small in size how can i maximize it ?

Here is Jframe image for your review : http://imagesup.net/?di=8136498001116

Any Comments and help. Appreciated. Thank You.

Was it helpful?

Solution

If you set it not to be resizable, you cannot maximize it either.

You also have to set some size for the frame. If you are using some layout managers and have some components added to your frame then just call frame.pack();

Otherwise, you need to do either frame.setSize(); or frame.setBounds(); which will help you set both location and size.

OTHER TIPS

f.setExtendedState( f.getExtendedState()|JFrame.MAXIMIZED_BOTH );
mv1.setResizable(true);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top