Here is the GUI code that I wrote today.

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class Lab5 {

    private JLabel label;
    private JComboBox combo;
    private JFrame frame;

    private class QuitListener implements ActionListener {
        public void actionPerformed(ActionEvent e) {    
            System.exit(0);
        }
    }

    private class ButtonListener implements ActionListener {
        private String text;
        
        public ButtonListener(String txt) {
            text = txt;
        }
        
        public void actionPerformed(ActionEvent e) {
            label.setText(text + " pressed");
            frame.pack();
        }
    }
    
    private class ComboBoxListener implements ActionListener {
        public void actionPerformed(ActionEvent e) {    
            label.setText(combo.getSelectedItem() + " selected");
            frame.pack();
        }
    }
    
    public Lab5() {
        frame = new JFrame("Lab 5");
        LayoutManager lom = new FlowLayout();
        frame.setLayout(lom);
        
        JButton button = new JButton("the button");
        button.addActionListener(new ButtonListener("the button"));
        frame.add(button);
        
        JButton button2 = new JButton("other button");
        button2.addActionListener(new ButtonListener("other button"));
        frame.add(button2);
        
        label = new JLabel("I'm a label!!");
        frame.add(label);
        
        combo = new JComboBox();
        combo.addItem("Hello");
        combo.addItem("Goodbye");
        combo.addActionListener(new ComboBoxListener());
        frame.add(combo);
        
        JMenuBar menu = new JMenuBar();
        JMenu file = new JMenu("File");
        JMenuItem quit = new JMenuItem("Quit");
        quit.addActionListener(new QuitListener());
        file.add(quit);
        menu.add(file);
        frame.setJMenuBar(menu);
        
        frame.pack();
        frame.setVisible(true);
    }
}