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

📄 splashwindow.java

📁 一个自己用JAVA写的聊天程序,希望对大家游泳
💻 JAVA
字号:
package liaotian;/* * SplashWindow.java * * Created on 2006年11月12日, 下午11:25 * * To change this template, choose Tools | Options and locate the template under * the Source Creation and Management node. Right-click the template and choose * Open. You can then make changes to the template in the Source Editor. *//** * * @author xingwang */import java.awt.*;import java.awt.event.*;import java.util.Enumeration;import javax.swing.*;public class SplashWindow extends JWindow implements ActionListener {    JLabel back = new JLabel(new ImageIcon("back.jpg"));    JProgressBar progressBar = new JProgressBar(1,50);    Timer timer;    int n=50;    public SplashWindow() {    	setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));    	progressBar.setStringPainted(true);    	progressBar.setString("正在加载程序......");    	getContentPane().add(back,"Center");    	getContentPane().add(progressBar,"South");    	setSize(234,260);    	toFront();    	setLocation(200,200);    	setVisible(true);    	timer = new javax.swing.Timer(50,this);    	timer.addActionListener(this);    	timer.start();    }    public void actionPerformed(ActionEvent e) {    	if(--n>0) {    		progressBar.setValue(50-n);    		timer.restart();    	}    	else {    		timer.stop();    		dispose();                JDialog.setDefaultLookAndFeelDecorated(true);		Font font = new Font("JFrame",Font.PLAIN,14);		Enumeration keys = UIManager.getLookAndFeelDefaults().keys();		while(keys.hasMoreElements()) {			Object key = keys.nextElement();			if(UIManager.get(key) instanceof Font)				UIManager.put(key, font);		}    		new MainFrame();    	}    }    public static void main(String args[]) {    	new SplashWindow();        //new MainFrame();    }}

⌨️ 快捷键说明

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