I'm creating a java program that in every second there is a data stored into my table. I made use of THread.sleep(1000) to pause the for loop in every second.. But when my program runs, it freezed for 10 seconds because of the condition of my for loop where the counter has not yet reached 10. So my last choice was to use a Thread that will run on different process so as not to freeze the UI cause i've been doing this with .net.... But the big problem is I dont know how will the created thread will have access to the TABLE object which is at the Mainclass.