Thread t = new Thread(new Runnable() {
@Override
public void run() {
while(true) {
try {
System.err.println("within the loop 7");
Thread.sleep(2000);
if(grid.isAttached() && grid.isVisible() ) {
updateLastActiveRuns();
}
} catch (InterruptedException e1) {
}
}
}
});
t.start();