Text delay

K

K

Does anyone know how to make certain text in a java application delay and display after the previous text
 
E

Eric Sosman

Does anyone know how to make certain text in a java application delay and display after the previous text

System.out.println("the previous text");
try {
Thread.sleep(desired_delay_in_milliseconds);
} catch (InterruptedException ex) {
System.out.println("This may be premature, but:");
}
System.out.println("certain text");

In other words, you'll get no better answer today than you did
three days ago unless you explain your situation more clearly.
 
B

bob smith

System.out.println("the previous text");

try {

Thread.sleep(desired_delay_in_milliseconds);

} catch (InterruptedException ex) {

System.out.println("This may be premature, but:");

}

System.out.println("certain text");



In other words, you'll get no better answer today than you did

three days ago unless you explain your situation more clearly.



--

Eric Sosman

(e-mail address removed)

I think he wants to do what's called a Toast.

http://en.wikipedia.org/wiki/Toast_(computing)
 
L

Lew

bob said:
I think he wants to do what's called a Toast.

http://en.wikipedia.org/wiki/Toast_(computing)

Maybe, but he insisted that he's talking about lines of text, so probably not.

It's not clear, and given that he already asked this question and got advice, and
opened up a new thread and provided no further clarification or elaboration,
one wonders if it's even worth the bother to address the question.
 
R

Rajiv Gupta

Does anyone know how to make certain text in a java application delay
and display after the previous text

There is always a delay after displaying text. This delay is provided
free of charge to you by the inherent latency in the JVM and the
operating system.
 
R

Roedy Green

Does anyone know how to make certain text in a java application delay and display after the previous text

you would create a timer that did a setText with different text on
each trigger.

See the code for SetClock. It updates the time periodically.

See http://mindprod.com/webstart/setclock.html
--
Roedy Green Canadian Mind Products http://mindprod.com
There are four possible ways to poke a card into a slot.
Nearly always, only one way works. To me that betrays a
Fascist mentality, demanding customers conform to some
arbitrary rule, and hassling them to discover the magic
orientation. The polite way to do it is to design the reader
slot so that all four ways work, or so that all the customer
has to do is put the card in the vicinity of the reader.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top