I would like to creat an apllication that install files in devices. but i have a problem to implement the progress, the code that i use in my fram to call the class to install is given below, execShellCmd is the method called to install to all devices. value is a static value gived by the Install class. i would like to implement a progressbar relited to install and value in order to give the progression of installation.
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
Thread t;
t = new Thread(){
private int postion;
public void run(){
Install install = new Install();
int position = 0;
String fileName = directory;
String shellCommand = fileName;
// for (int position =0; postion < 105;position +5) {
jProgressBar1.setValue(Install.value);
try {
Thread.sleep(500);
} catch (InterruptedException e) {
}
position += 5;
//}
install.execShellCmd(shellCommand);
//jTextArea1.setText(error.err.toString());
}
};
t.start();
}