package com.msksbr.MainFrm.MenuItemDiaog;

import com.msksbr.LoginFrm.ScreenSize;

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

public class AcademyThanksDialog extends JDialog {
    private JPanel contentPane;
    private JButton buttonOK;
    private JLabel imageLabel;

    public AcademyThanksDialog() {
        setTitle("鸣谢");
        setContentPane(contentPane);
        setModal(false);
        getRootPane().setDefaultButton(buttonOK);

        buttonOK.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                onOK();
            }
        });
        imageLabel.setIcon(new ImageIcon("src/com/msksbr/images/academy_logo.png"));
        pack();
        setResizable(false);
        setLocation();
        setAlwaysOnTop(true);
        setVisible(true);
    }

    private void onOK() {
        // 在此处添加您的代码
        dispose();
    }

    public void setLocation() {
        setLocation(new ScreenSize().width / 2 - getWidth() / 2, new ScreenSize().height / 2 - getHeight() / 2);
    }
}
