⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 about.java

📁 java+sql 图书管理系统
💻 JAVA
字号:
package MyLibraryok.MyMain;

import java.awt.*;

import javax.swing.*;

/**
 * <p>Title: </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2007</p>
 *
 * <p>Company: </p>
 *
 * @author not attributable
 * @version 1.0
 */
public class About extends JDialog {
    Dimension screen = getToolkit().getScreenSize(); //得到屏幕尺寸

    int myWidth = screen.width;
    int myHeight = screen.height;
    int x = 400;
    int y = 300;

    BorderLayout borderLayout1 = new BorderLayout();
    JLabel label = new JLabel(new ImageIcon("Image/About.png"));
    public About(MainFrame2 ss) {
        super(ss, "", true);
        try {
            jbInit();
        } catch (Exception exception) {
            exception.printStackTrace();
        }
    }

    JFrame n = new JFrame();
    private void jbInit() throws Exception {
        TransparentBackground bg = new TransparentBackground(n);
        bg.updateBackground();
        getContentPane().setLayout(borderLayout1);
        this.addMouseListener(new AboutMouseListener(this));

        bg.setLayout(new BorderLayout());
        bg.add("Center", label);
        this.setUndecorated(true);
        this.getContentPane().add(bg);
        // Center the frame
        if (x >= myWidth || y >= myHeight) {
            x = myWidth;
            y = myHeight;
            this.setSize(x, y);
            this.setLocation(0, 0);
        } else {
            this.setSize(x, y);

            this.setLocation((myWidth - this.getSize().width) / 2,
                             (myHeight - this.getSize().height) / 2);
        }
        this.setVisible(true);

    }

    public static void main(String[] args) {
        About frame2 = new About(null);
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -