Menjalankan JProsses Bar
public class prosesin implements Runnable{
public void run() {
for (int i=0; i<=100; i++){ //Progressively increment variable i
jProgressBar1.setValue(i); //Set value
jProgressBar1.repaint(); //Refresh graphics
jLabel6.setText(""+i+"%");
if(i==0){
jLabel5.setText("Loading .................................");
} if(i==40){
jLabel5.setText("Loading Database........................");
} if(i==60){
jLabel5.setText("Opening Database........................");
} if(i==85){
jLabel5.setText("Opening Database Complete ...............");
} if(i==100){
jLabel5.setText("Opening Database Complete ...............");
jLabel5.setText("");
jLabel6.setText("");
}
try{Thread.sleep(20);} //Sleep 50 milliseconds
catch (InterruptedException err){}
}
}
//panggil aplikasi yang telah dibuat//new Form().setVisible(true);
}
untuk memangil mentod class :
private void LoginActionPerformed(java.awt.event.ActionEvent evt) {
new Thread(new prosesin()).start(); // proseses();
}
Simpel kan
web support
www.klikcover.com
Tidak ada komentar:
Posting Komentar