void parseButtons(JButton[] buttons) {
        for (int i = 0; i < buttons.length; i++) {
            if (buttons[i].getText().toLowerCase().contains("close")) {
                buttons[i].addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        window.dispatchEvent(new WindowEvent(window, WindowEvent.WINDOW_CLOSING));
                    }
                });
            } else if (buttons[i].getText().toLowerCase().contains("return")) {
                buttons[i].addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        window.setVisible(false);
                    }
                });
            }
        }
    }