Código
import javax.swing.*; import java.awt.*; import java.io.File; /** * * @author Afsoon de elhacker para la gente de elhacker y el resto, permito * su distribución con la acredeticación del autor del código base * */ private Threadbar thread; public Splash(){ super(""); defineVentana(); //Here create the new thread thread = new Threadbar(bar); //Start Thread thread.start(); //Here get point x,y where will appear Window // This Operations is provided by Darhius elhacker int x = (int)((java.awt.Toolkit.getDefaultToolkit().getScreenSize().width)- this.getSize().width)/2; int y = (int)((java.awt.Toolkit.getDefaultToolkit().getScreenSize().height)- this.getSize().height)/2; //Size and basic this.setLocation(x, y); this.setSize(400,300); this.setVisible(true); //Empty the memory thread = null; } public void defineVentana(){ //Image Splash //Progress bar.setBorderPainted(true); bar.setStringPainted(true); //Add component in the Layout } } public void pausa(int mSeg){ try { { showError(e); } } { this.bar = bar; } public void run(){ for(int i=0;i <= 100; i++) { bar.setValue(i); pausa(100); } } } }