1 import java.awt.*; 2 import java.awt.event.*; 3 import java.awt.image.ImageObserver ; 4 import java.io.Serializable ; 5 import java.util.*; 6 import javax.swing.*; 7 import javax.accessibility.Accessible ; 8 9 10 11 public final class JSplash extends JWindow implements Accessible , ImageObserver , MenuContainer, RootPaneContainer,Serializable { 12 13 15 private final JProgressBar pbar=new JProgressBar(1,14); 16 17 private int v=1; 18 19 20 public JSplash(){ 21 super(); 22 Container cp=getContentPane(); 25 cp.setLayout(new BorderLayout(20,20)); 26 pbar.setStringPainted(true); 27 pbar.setString(" Whisper IM Loading... "); 28 pbar.setBorderPainted(false); 29 setSize(pbar.getWidth()*2,pbar.getHeight()); 30 cp.add(pbar,BorderLayout.CENTER); 31 setCursor(GUI.WAIT); 32 33 pack(); 34 setLocationRelativeTo(null); 35 } 36 37 public void show(){ 38 super.show(); 40 inc(); 41 } 42 43 public void inc(){ 44 v++; 45 pbar.setValue(v); 46 pbar.update(pbar.getGraphics()); 47 } 48 49 } | Popular Tags |