Java program to create an empty frame as an instance
KW.java
import javax.swing.JFrame;
class KW
{
    public static void main(String args[])
    {
        JFrame frame=new JFrame("Frame");
        frame.setSize(300,300);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setVisible(true);
    }
}
Output
kodingwindow@kw:~$ javac KW.java
kodingwindow@kw:~$ java KW
Advertisement