JFrame frame = new JFrame(); // Create a frame (i.e. a window)
JLabel label = new JLabel("Hello, World!"); // Create a text label
frame.add(label); // Add the label to the frame's contents
frame.pack(); // Resize the frame to fit the label
frame.setVisible(true); // Display the frame