Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

java swing timer sleep

System.out.println("Hi");
//Now it will pause
try{
  Thread.sleep(5000)//Time in milliseconds->5000==5 seconds 
  //^freezes whole program for amount of time
  System.out.println("Hola");//Appears after 5 seconds
}
catch(InterruptedException e){
  System.err.println(e.getMessage());
}
Comment

PREVIOUS NEXT
Code Example
Java :: how to remove components from a JFRame java 
Java :: how to delete files in java 
Java :: jdk path ubuntu 
Java :: anagram java program 
Java :: how to iterate hashset in java 8 
Java :: get device id programmatically android 
Java :: javafx textarea font size 
Java :: how to sort a list of integers in java 
Java :: How to convert timestamp to time in android studio 
Java :: print line in jjava 
Java :: create date java 
Java :: how to initialize an array in java 
Java :: how to convert int array to integer list in java 
Java :: how to find a number in a string java 
Java :: text.settextcolor android 
Java :: java string to path 
Java :: java get random char from alphabet 
Java :: java alert box 
Java :: how to calculate the amount of months between two dates java 
Java :: java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7 
Java :: prime number between given range in java 
Java :: get random word from list java 
Java :: java get classname 
Java :: how to check whether a character is vowel in java 
Java :: java calendar hour vs hour of day 
Java :: reading csv file in java 
Java :: jframe set visibility 
Java :: RecyclerView: No layout manager attached; skipping layout 
Java :: toast no android 
Java :: android studio, not loading url in webview 
ADD CONTENT
Topic
Content
Source link
Name
3+3 =