Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Vasileios

macrumors regular
Original poster
Oct 28, 2005
121
0
Greece
Is there a way that i can save all the output that i have on the screen(Numbers and text) into a text file?
Thanks...
 

HiRez

macrumors 603
Jan 6, 2004
6,265
2,629
Western US
Vasileios said:
Is there a way that i can save all the output that i have on the screen(Numbers and text) into a text file?
Thanks...
Need a bit more information. What is the format of your Java app? Is your app being run from the command-line and where the numbers and text are being printed to the console, or do you have a graphical app where they are they in UI objects like tables and text fields?
 

Vasileios

macrumors regular
Original poster
Oct 28, 2005
121
0
Greece
it's a simple quess game...
the results (the number you enter-if you quess is too low, or too hight, the choice to play again etc.) are printed in the console... no grafics at all... just text...
 

plinden

macrumors 601
Apr 8, 2004
4,029
142
Even simpler than adding to your code - run in command line with '>' i.e.:

java -cp . MyClass > result
 

jeremy.king

macrumors 603
Jul 23, 2002
5,479
1
Holly Springs, NC
plinden said:
Even simpler than adding to your code - run in command line with '>' i.e.:

java -cp . MyClass > result

Guess that would work too. But I figured he was asking how to code it since it is a programming forum category.
 

Compile 'em all

macrumors 601
Apr 6, 2005
4,131
359
Vasileios said:
it's a simple quess game...
the results (the number you enter-if you quess is too low, or too hight, the choice to play again etc.) are printed in the console... no grafics at all... just text...

Probably in your program you are using System.out.println() to write text to
the console. Instead use FileWriter to write to a file. As a MacRumors fellow
pointed out, take a look at Java I/O docs on SUN's website.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.