consider using Thread.sleep(miliseconds);
class Fubar1
{
public static void main(String[] args)
{
try
{
Thread.sleep(2000);
System.out.println("hello there!");
Thread.sleep(3000);
System.out.println("hello there again!");
}
catch (InterruptedException ie)
{
ie.printStackTrace();
}
}
}
thx but there seems to be problem.
I have a single jframe with textbox.
I have while cyclus which goes trough text and highlights some character which match some pattern. i need to wait after each highlight, because user needs to see it. when i used thread sleep, the program waited, but no highlighting was visible, only when cyclus ended, the last highlight was visible. What could be the problem?