Witam,
JProgressBar nie wyświetla postępu. W ogóle nie widać żadnych zmian. Co robię źle?
jProgressBar2.setMinimum(0);
jProgressBar2.setMaximum(authors.size()-1);
int nOfAuthor = 0;
ProgressBar2Thread progressBar2Thread = new ProgressBar2Thread();
Thread t = new Thread(progressBar2Thread);
t.start();
for (modelRsds.Author author : authors) {
nOfAuthor += 1;
String expertName = author.getName() + " " + author.getLastname();
progressBar2Thread.setN(nOfAuthor);
try {
System.out.println(expertName);
class ProgressBar2Thread implements Runnable {
private int n;
public void run() {
jProgressBar2.setValue(n);
}
public void setN(int n) {
this.n = n;
}
}