Linked Questions

Popular Questions

Making a Thread sleep until some other work is done

Asked by At

My application starts, where it will automatically creates some database tables if not exist and creates also some default values in those tables(doing this in background using swingworker). Then the application continues and reads some data from those tables, I need the second process(reading from those tables) to wait for some seconds until the tables are created from previous step. I've used the Thread.sleep(2000); but it's not accepted in NetBeans as this is heappeing when I'm opening the window like this formWindowOpened(java.awt.event.WindowEvent evt) How can I do that?

Related Questions