1. use a bufferedimage
2. take its graphics object and draw the freehand on that grahics (g.drawLine...)
3. use imageIO in
java 1.4.2 to save it JPG format and you can load that image.
4. however if you want to save only the coordinates, then first collect the coordinates in a Vector orany collection class. then save the Vector maybe using serialization, or you can use a simple text file to save the coordinates. To load the image, you can read the coordinates from the file and draw the lines accordingly.