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 AuthorDIalog extends JDialog {
    private JPanel contentPane;
    private JButton buttonOK;
    private JPanel iconPanel;

    public AuthorDIalog() {
        setContentPane(contentPane);
        setModal(false);
        getRootPane().setDefaultButton(buttonOK);
        setVisible(false);
        JLabel authorLabel = new JLabel();
        authorLabel.setIcon(new ImageIcon("src/com/msksbr/images/AuthorProfile.jpg"));
        iconPanel.add(authorLabel);
        setDefaultCloseOperation(DISPOSE_ON_CLOSE);
        setTitle("作者");
        buttonOK.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                dispose();
            }
        });
        setResizable(false);
        setAlwaysOnTop(true);
        pack();
        setLocation();
    }

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