import javax.swing.JFrame; public class MyGUI { public static void main(String[] args) { JFrame frame = new JFrame("My First GUI"); // Create a new JFrame frame.setSize(400, 300); // Set the size of the window (width, height) frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // Close operation frame.setVisible(true); // Make the window visible } }