I created a swing app and there are two buttons on the interface. When use clicks a button it will carry out some series of action, I want to use a timer object to control create a some seconds delay after each action happen because i have a run time object within my code. My program basically do the following stuff: Generate button : generate swing script code and save into a x.java file. Compile Button: executing a .bat file to compile it into a x.class, and then delete the .bat file after compiling. Usually it will takes a few second to run the bat file within the app. Sometimes the bat file is being deleted before compiling. My bat file is has only one line of code "javac xxx.java". I hope i explained it clear enough. Can anyone give some ideas of how use a timer to delay two actions? Thanks! I appreciate for your response! Mindy