?? client.java
字號:
package client;
/*
* 創(chuàng)建日期 2006-6-5
* 作者: 褚廷軍
* 項目名稱:學生考試系統(tǒng);
* 項目要求:畢業(yè)設(shè)計;
* 模塊名稱:客戶端歡迎界面
*/
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Client extends JWindow implements ActionListener
{
/**
*
*/
private static final long serialVersionUID = 688218996681867439L;
JLabel label;
Icon icon;
Timer timer1,timer2;
JProgressBar progress;
int i=0,n=0,j=0;
String s="歡迎使用網(wǎng)絡(luò)考試系統(tǒng)";
public Client()
{
icon=new ImageIcon("welcome.jpg");
label=new JLabel(icon,JLabel.CENTER);
label.setFont(new Font("隸書",Font.BOLD,86));
label.setHorizontalTextPosition(JLabel.CENTER);
label.setVerticalTextPosition(JLabel.CENTER);
timer1=new Timer(20,this);
timer2=new Timer(130,this);
progress = new JProgressBar(1,150);
progress.setStringPainted(true);
progress.setBorderPainted(false);
progress.setFont(new Font("隸書",Font.BOLD,36));
progress.setString("考試系統(tǒng)正在加載,請稍后...");
progress.setBackground(Color.white);
timer1.start();
timer2.start();
Container con=getContentPane();
con.add(label,BorderLayout.CENTER);
con.add(progress,BorderLayout.SOUTH);
//setBounds(0,0,1025,750);
this.setSize(1024,730);
setVisible(true);
validate();
}
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==timer1)
{
i=i+1;
j=(j+2)%360;
Color color=new Color((3*i)%255,(7*i)%255,(11*i)%255);
label.setForeground(color);
progress.setValue(progress.getValue() + 1);
if(i>=150)
{
JFrame.setDefaultLookAndFeelDecorated(true);
new TestGui();
this.dispose();
timer1.stop();
timer2.stop();
}
}
if(e.getSource()==timer2)
{
if(n<12)
{
label.setText(s.substring(0,n));
if(n==10)
n=0;
}
n++;
}
}//
public static void main(String args[])
{
new Client();
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -