Java application help?????????????  
Author Message
gsgumbo





PostPosted: 2004-5-3 3:47:00 Top

java-programmer, Java application help????????????? How do you create a pause in a Java application that requires you to
press a key to continue until the conditional statement is complete?
The folowing is what I have so far..

class Count{
public static void main(String[] arguments) throws Exception {

int a = 100;
int b = 20;
int x;


for (x = 0;x < a;x++) {


System.out.println((x+1) + "." + "Message goes here to be displayed
100 times.");

}

I would like the application to display 1 - 20 then pause and display
20 more and 20 more and so on. I tried to use System.in.read();, but
it only displayed two at a time. Please Help.
 
Karthik





PostPosted: 2004-5-3 4:58:00 Top

java-programmer >> Java application help????????????? S. Gregory wrote:

> How do you create a pause in a Java application that requires you to
> press a key to continue until the conditional statement is complete?
> The folowing is what I have so far..
>
> class Count{
> public static void main(String[] arguments) throws Exception {
>
> int a = 100;
> int b = 20;
> int x;
>
>
> for (x = 0;x < a;x++) {
>
>
if ( a % 20 == 0) {
System.in.read();
}
Every 20 times this one pauses for you .

> System.out.println((x+1) + "." + "Message goes here to be displayed
> 100 times.");

>
> }
>
> I would like the application to display 1 - 20 then pause and display
> 20 more and 20 more and so on. I tried to use System.in.read();, but
> it only displayed two at a time. Please Help.


--
Karthik
Humans please 'removeme_' for my real email.