Posted on

GHZGDJJH

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

// Subclass extending BasicWindow for a main application window
public class MainWindow extends BasicWindow {
    private JButton button1, button2, button3;

    public MainWindow(String title, int width, int height) {
        super(title, width, height);

        // Components specific to MainWindow
        button1 = new JButton("Button 1");
        button2 = new JButton("Button 2");
        button3 = new JButton("Button 3");

        // Layout setup using GridLayout
        JPanel panel = new JPanel(new GridLayout(3, 1));
        panel.add(button1);
        panel.add(button2);
        panel.add(button3);

        add(panel);

        // Set up additional functionality
        button1.addActionListener(e -> JOptionPane.showMessageDialog(this, "Button 1 clicked!"));
        button2.addActionListener(e -> JOptionPane.showMessageDialog(this, "Button 2 clicked!"));
        button3.addActionListener(e -> JOptionPane.showMessageDialog(this, "Button 3 clicked!"));
    }
}