import java.awt.Dimension;
import java.awt.Frame;
import java.awt.Graphics;
import java.awt.event.ComponentAdapter;
import java.awt.event.ComponentEvent;
import java.awt.event.MouseAdapter;
import java.awt.image.BufferedImage;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author Administrator
*/
public class SplashScreeen extends javax.swing.JDialog {
public static final int SPLASH_MODE = 0;
public static final int ABOUT_MODE = 1;
private Frame frame = null;
private BufferedImage image = null;
public SplashScreeen(Frame frame, int mode, BufferedImage image) {
if (frame == null) {
throw new IllegalArgumentException("frame must be not null");
}
if (mode != SPLASH_MODE && mode != ABOUT_MODE) {
throw new IllegalArgumentException("mode must be one of SPLASH_MODE or ABOUT_MODE");
}
if (image == null) {
throw new IllegalArgumentException("image must be not null");
}
this.frame = frame;
this.image = image;
if (mode == SPLASH_MODE) {
frame.addComponentListener(new ComponentAdapter() {
@Override
public void componentShown(ComponentEvent e) {
SplashScreeen.this.dispose();
}
});
} else {
addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(java.awt.event.MouseEvent evt) {
SplashScreeen.this.dispose();
}
});
}
initComponents();
this.setSize(new Dimension(image.getWidth(), image.getHeight()));
this.setLocationRelativeTo(null);
}
private void initComponents() {
this.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
this.setAlwaysOnTop(true);
this.setUndecorated(true);
this.getContentPane().setLayout(null);
}
@Override
public void paint(Graphics g) {
if (image != null) {
g.drawImage(image, 0, 0, this);
}
}
}
Ysf.rar_netbeans_约瑟夫问题
版权申诉
106 浏览量
2022-09-24
13:57:51
上传
评论
收藏 16KB RAR 举报
局外狗
- 粉丝: 64
- 资源: 1万+
最新资源
- VR开发的概要介绍与分析
- 自动驾驶定位系列教程七:点云畸变补偿.pdf
- HM2302D-VB一款N-Channel沟道SOT23的MOSFET晶体管参数介绍与应用说明
- HM2302B-VB一款N-Channel沟道SOT23的MOSFET晶体管参数介绍与应用说明
- springboot学生考勤管理系统
- HM2302A-VB一款N-Channel沟道SOT23的MOSFET晶体管参数介绍与应用说明
- HM2301-VB一款P-Channel沟道SOT23的MOSFET晶体管参数介绍与应用说明
- 数据可视化的概要介绍与分析
- HM2301E-VB一款P-Channel沟道SOT23的MOSFET晶体管参数介绍与应用说明
- HM2301D-VB一款P-Channel沟道SOT23的MOSFET晶体管参数介绍与应用说明
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈