JAVA Program using Swing to Display Blank Window

JAVA Program using Swing to Display Blank Window :

import javax.swing.*;

    class MyFrame extends JFrame {
      public MyFrame()
      {
        setTitle("My Empty Frame");
        setSize(300,200);    // default size is 0,0
        setLocation(10,200);  // default is 0,0 (top left corner)
      }

      public static void main(String[] args) {
        JFrame f = new MyFrame();
        f.show();
      }
    }

OUTPUT:

JAVA Program using Swing to Display Blank Window

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.