I have a Arraylist, which i want to save in a file for use in the application another time, I've read several places that i can use this code to do this, but it doesn't work, it returns a error right after it prints out 3:

```
 private void savegame(){
    try {System.out.println("1");
        FileOutputStream preout = new FileOutputStream(new File("savedgame.ser"));
        System.out.println("2");
        ObjectOutputStream out = new ObjectOutputStream(preout);
        System.out.println("3");
        out.writeObject(kortene);
        System.out.println("4");
        out.close();
        System.out.println("5");
        preout.close();
        System.out.println("6");
        output = new FileWriter(new File("saved game settings.txt"));
        System.out.println("7");
        output.write(Indstillinger.BilledeMappe+"\n"+Indstillinger.AntalKort+
                "\n"+Indstillinger.AntalSpillere+"\n"+clicks+"\n"+Score);
        System.out.println("8");
        output.close();
        System.out.println("game save success");
    }catch (Exception e) {
        System.out.println("game save failed");
    }

```

and "kortene" is a ArrayList created like this: 

```
public static ArrayList<Kort> kortene = new ArrayList<Kort>();

```

and Kort is a class i made, but that isn't relevant for this problem i assume.. 

the error i get is: java.io.NotSerializableException: java.awt.image.BufferedImage

but i dont have a BufferedImage, i just have a normal image in each of the classes...