text file display options in console

Hi,

I have a real simple console app that reads in a text file and

prints it to the console. It is longer than the console is tall

so it is diplayed starting at the bottom and the user has to scroll up

to start reading at the top of the file.

Is there any way to have it display from the first line down?

The only way I have figured out so far is to break the file into seperate files,

read those in one by one and have the user hit enter to advance to the next page.

Here is how the file is read in:

Scanner fR =new Scanner(new FileReader(usrDbChoice +".txt"));

if (usrDbChoice.equalsIgnoreCase("help")){

while (fR.hasNextLine()){

String helpFile = fR.nextLine();

System.out.println(helpFile);

}

Thanks for any help

bill

[1090 byte] By [ThatJivea] at [2007-10-3 7:26:42]
# 1
Hi,Why break the file into separate files? Just print a few lines from the original file, wait for enter, print a few more lines, wait for enter...Kaj
kajbja at 2007-7-15 2:25:34 > top of Java-index,Java Essentials,New To Java...
# 2

> Why break the file into separate files? Just print a

> few lines from the original file, wait for enter,

> print a few more lines, wait for enter...

Hey, kaj

Thanks, That makes alot of sense.

Thanks again for getting over the hump and jump starting my brain

ThatJivea at 2007-7-15 2:25:34 > top of Java-index,Java Essentials,New To Java...
# 3

This is what I came up with:

if (usrDbChoice.equalsIgnoreCase("help")) {

boolean hlp=true;

int cnt=0;

while(hlp){

cnt++;

for(int i=0;i<30;i++){

String helpFile = fR.nextLine();

System.out.println(helpFile);

}

sc.nextLine();

if(cnt==3){

hlp=false;

}

}

Thanks again :o)

ThatJivea at 2007-7-15 2:25:34 > top of Java-index,Java Essentials,New To Java...