Report as inappropriate.
The scenario shows how to use file I/O (Input/Output) in Greenfoot.
Most file I/O is prevented by the Security Manager when running as an applet. All the scenarios in the Greenfoot Gallery run as applets.
We can do file I/O in the Greenfoot editor or when running as an application. Also, we can read text files that were included in the JAR file for the scenario. Reading from a JAR file is useful, for example, when changing levels or worlds.
To include text files in the JAR file, just add the files to the scenario folder.
Thanks to davmac for his suggestion on how to detect if the scenario is running as an application or as an applet.
The GUI components are part of GUI World at
http://www.greenfootgallery.org/scenarios/2371
There is no HTML 5 translation of this scenario available.
View legacy version (requires Java plugin)
This scenarios uses Java features that are not available for use after conversion to HTML 5. Please try the legacy version, which requires the Java plugin to be installed.
Want to leave a comment? You must first log in.