This site requires JavaScript, please enable it in your browser!
Greenfoot back
kiarocks
kiarocks wrote ...

2011/7/25

How to save files?

kiarocks kiarocks

2011/7/25

#
I would like to save files for you to read later, but, i am not sure how to do it.
mjrb4 mjrb4

2011/7/25

#
Are you talking about in a scenario on the gallery, to save high scores and the like? If so it's not something that can be done at present. It has been talked about in the past, but as far as I know it's not something that anyone is looking at at the moment.
kiarocks kiarocks

2011/7/25

#
no, in greenfoot
mjrb4 mjrb4

2011/7/25

#
You should really be much more specific with your questions generally - even though you've now said "in Greenfoot", do you mean saving a file programmatically from a scenario? Saving the scenario to disk? Saving a particular source file in a scenario to disk? If you phrased your questions more specifically and less ambiguously to start with you'd find what you wanted to much quicker!
kiarocks kiarocks

2011/7/26

#
i think i need a file that will save from greenfoot and .jar, but i dont know any code for doing that. it also needs to store .txt files that the user can read in text edit(mac) or with my program.
danpost danpost

2011/7/26

#
@kiarocks, the java (oracle) site Basic I/O has all the information you need to Open, Read, Write, and Create files in Java. For an example look at my Fractal Fun scenario (with-source) that saves image files. Look in the 'Graph' (World) class and the final method is the 'saveImage()' method.
You need to login to post a reply.