Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   Text delay (http://www.velocityreviews.com/forums/t953616-text-delay.html)

K 10-19-2012 05:15 PM

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

Eric Sosman 10-19-2012 05:49 PM

Re: Text delay
 
On 10/19/2012 1:15 PM, K wrote:
> 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.

--
Eric Sosman
esosman@comcast-dot-net.invalid

Daniele Futtorovic 10-19-2012 08:58 PM

Re: Text delay
 
On 19/10/2012 19:15, K allegedly wrote:
> Does anyone know how to make certain text in a java application delay
> and display after the previous text


Yes.

--
DF.

bob smith 10-19-2012 09:56 PM

Re: Text delay
 
On Friday, October 19, 2012 12:49:32 PM UTC-5, Eric Sosman wrote:
> On 10/19/2012 1:15 PM, K wrote:
>
> > 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.
>
>
>
> --
>
> Eric Sosman
>
> esosman@comcast-dot-net.invalid


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

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

Lew 10-20-2012 01:18 AM

Re: Text delay
 
bob smith wrote:
>Eric Sosman wrote:
>> K wrote:
>>> 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.

>
> 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.

--
Lew

Rajiv Gupta 10-20-2012 03:49 AM

Re: Text delay
 
On 2012-10-20 04:15:27 +1100, K said:

> 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.


Roedy Green 10-21-2012 02:37 AM

Re: Text delay
 
On Fri, 19 Oct 2012 10:15:27 -0700 (PDT), K <kalezwe@gmail.com> wrote,
quoted or indirectly quoted someone who said :

>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.




All times are GMT. The time now is 04:12 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.