¿Cómo cambiar el valor de la barra de progreso y la etiqueta?
losJLabel
yJProgressBar
no cambie su valor, solo cuando finalice el método.
this.desSave.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
DownloadXml();
}
});
private void DownloadXml() throws Exception {
Integer a = 456;
int value = (1000 / a) - 1;
this.numDes.setText("0" + "/" + a);
for (int i = 0; i < a; i++) {
saveXml(ligas.get(i),i,path);
this.numDes.setText(i + "/" + a); //this is a jlabel
this.progressbar.setValue(value * i); //jprogressbar
}
}
private void SaveXml(String xml,int a,String path) throws IOException {
}