I get the following Exception thrown when I try to save (write) the image ThumbPanel objects to a file:
IOException: java.io.NotSerializableException: sun.awt.AppContext.
The strange thing about it is that the Exception is not thrown every time i try to use the write method..
Can anyone help me correct this problem and tell me what the IOException thrown actually means, and why it is thrown in the first place.
Thank you.
the method where I get the error:
/**
Writes out this ThumbPanel's data to out.
@param out The file to which the data is written.
*/
public void write(ObjectOutputStream out)
{
try
{
out.writeObject(data);
}
catch (IOException E)
{
System.err.println("IO Exception: " + E); /////////////////
//I get the following error// IOException: java.io.NotSerializableException: sun.awt.AppContext
//////////////////
}
}
IOException: java.io.NotSerializableException: sun.awt.AppContext.
The strange thing about it is that the Exception is not thrown every time i try to use the write method..
Can anyone help me correct this problem and tell me what the IOException thrown actually means, and why it is thrown in the first place.
Thank you.
the method where I get the error:
/**
Writes out this ThumbPanel's data to out.
@param out The file to which the data is written.
*/
public void write(ObjectOutputStream out)
{
try
{
out.writeObject(data);
}
catch (IOException E)
{
System.err.println("IO Exception: " + E); /////////////////
//I get the following error// IOException: java.io.NotSerializableException: sun.awt.AppContext
//////////////////
}
}