Picutre downloader

As swing is single threaded you can't access it from other thread as the drawing thread. As such your update() methods throw an exception and don't update the card coutner x/23131.
It should be accessed like:
It should be accessed like:
- Code: Select all
private void update(int card) {
this.card = card;
final class Worker implements Runnable{
private int card;
Worker(int card){
this.card = card;
}
public void run() {
fireStateChanged();
bar.setString(String.format(ForgeProps.getLocalized(card == cards.length? BAR_CLOSE:BAR_WAIT), card,
cards.length));
System.out.println(card + "/" + cards.length);
}
};
EventQueue.invokeLater(new Worker(card));
}