//Similar to Authority.java from Lewis/Loftus import java.awt.*; import javax.swing.*; public class GUI { public static void main(String[] args) { JFrame frame = new JFrame("First GUI"); //takes title for window frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JPanel panel = new JPanel(); panel.setBackground(Color.red); panel.setPreferredSize(new Dimension(250, 75)); JLabel label = new JLabel("My first GUI"); panel.add(label); //add label to panel frame.getContentPane().add(panel); //add panel to content pane of frame frame.pack(); //size to the preferred size frame.setVisible(true); //make visible } }