Picutre downloader
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
Picutre downloader
by Snacko » 16 Jan 2010, 09:18
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));
}
1 post
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 93 guests