import java.util.*; // This code shows how to have the turtle draw on an image/picture and // how to save that picture to the local computer. // // The code will save the image in the JPEG format. Be sure to specify // the file extension of ".jpg" at the end of the filename!!! // // Also expect to get a warning that states: // show() in java.awt.Component has been deprecated // You can ignore this warning public class MyTurtleTestV2 { public static void main(String[] args) { // Create an empty picture and place the turtle into it Picture pict = new Picture (640, 480); Turtle turtle1 = new Turtle(pict); // Do some simple operations turtle1.forward(100); turtle1.turn (90); turtle1.forward(100); // display the picture pict.show(); // save the picture to the computer // Note: Be sure to add the .jpg to the end of the filename!!!!! String fileName = FileChooser.pickAFile(); System.out.println(fileName); pict.write (fileName); } }