making text appear delayed

前端 未结 4 1936
故里飘歌
故里飘歌 2021-01-22 08:19

I want to make text appear in the following way:

H
wait 0.1 seconds
He
wait 0.1 seconds
Hel
wait 0.1 seconds
Hell
wait 0.1 seconds
Hello

But I\

4条回答
  •  天涯浪人
    2021-01-22 09:18

    Try this:

     try {
      Thread.sleep(timeInMiliseconds); // In your case it would be: Thread.sleep(100);
    } catch (Exception e) {
        e.printStackTrace();
    }
    

提交回复
热议问题