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

📄 splashscreen.java

📁 用Java实现的粒子群优化算法
💻 JAVA
字号:
// Decompiled by Jad v1.5.7f. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   SplashScreen.java

package ci.util.gui;

import java.awt.*;

public class SplashScreen extends Window
{

    public SplashScreen()
    {
        super(new Frame());
        setSize(500, 300);
        firstString = "Loading Java";
        secondString = "be patient";
    }

    public SplashScreen(String s, String s1)
    {
        super(new Frame());
        setSize(500, 300);
        firstString = s;
        secondString = s1;
    }

    public static void main(String args[])
    {
        SplashScreen splashscreen = new SplashScreen();
        splashscreen.setVisible(true);
    }

    public void paint(Graphics g)
    {
        setBackground(Color.yellow);
        Dimension dimension = getSize();
        g.setColor(Color.red);
        g.drawRect(5, 5, dimension.width - 10, dimension.height - 10);
        g.drawRect(7, 7, dimension.width - 14, dimension.height - 14);
        Font font = new Font("TimesRoman", 3, 30);
        g.setFont(font);
        FontMetrics fontmetrics = getFontMetrics(font);
        int i = (dimension.width - fontmetrics.stringWidth(firstString)) / 2;
        int j = dimension.height / 2 - fontmetrics.getHeight();
        g.drawString(firstString, i, j);
        font = new Font("TimesRoman", 2, 24);
        g.setFont(font);
        fontmetrics = getFontMetrics(font);
        i = (dimension.width - fontmetrics.stringWidth(secondString)) / 2;
        j += fontmetrics.getHeight();
        g.drawString(secondString, i, j);
    }

    private String firstString;
    private String secondString;
}

⌨️ 快捷键说明

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