📄 splashscreen.java
字号:
package rebot;
import java.awt.*;
import javax.swing.*;
import java.net.URL;
public class SplashScreen extends JWindow {
private int duration;
public SplashScreen(int d) {
duration = d;
}
public void showSplash() {
JPanel content = (JPanel) getContentPane();
int width = 182;
int height = 211;
Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
int x = (screen.width - width) / 2;
int y = (screen.height - height) / 2;
setBounds(x, y, width, height);
URL url1;
url1 = getClass().getResource("/image/doraemon.gif");
JLabel label = new JLabel(new ImageIcon(url1));
label.setOpaque(false);
content.setBackground(new Color(88, 183, 216));
content.add(label);
setVisible(true);
try {
Thread.sleep(duration);
} catch (Exception e) {
}
setVisible(false);
}
public void showSplashAndExit() {
showSplash();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -