احتمالاٌ مشکل همون conflict باشه چون برنامه خیلی سادست اینم سورسش:
کد:Thread ks=new Thread(new Runnable() { public void run() { while(1==1){ System.out.println("dally"); try { Thread.sleep(5000); } catch (InterruptedException ex) { Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex); } } } }); ks.start();