public void setNewsIcon () {
/* Call unreadNews swingworker
* done() will set news tab icon
*/
UnreadNewsWorker unreadNews = new UnreadNewsWorker() {
@Override
protected void done () {
try {
int i = get();
if (i > 0 && i < 100) {
ImageAndTextIcon iti = new ImageAndTextIcon(this.getClass().getResource("/image/tabs/news_unread_" + Integer.toString(i).length() + ".png"), Integer.toString(i));
iti.setImage(LauncherStyle.getCurrentStyle().filterHeaderIcon(this.getClass().getResource("/image/tabs/news_unread_" + Integer.toString(i).length() + ".png")).getImage());
LaunchFrame.getInstance().tabbedPane.setIconAt(0, iti);
} else {
LaunchFrame.getInstance().tabbedPane.setIconAt(0, LauncherStyle.getCurrentStyle().filterHeaderIcon(this.getClass().getResource("/image/tabs/news.png")));
}
} catch (InterruptedException e) {
} catch (ExecutionException e) {
}
}
};
unreadNews.execute();
}