java.io.NotSerializableException: paint.Main$1
hi everybody this is my problem...
i have this code:
public class Main extends JFrame
{
class figura implements Serializable
{
Point x, y;
int tipo;
int rettipo(){ return tipo;}
public Point retx(){ return x;}
public Point rety(){ return y;}
void ponertipo(int a){ tipo = a; }
void ponerpx(Point a){ x = a; }
void ponery(Point a){ y = a;}
};
JFileChooser archivos = new JFileChooser();
Vector almacen = new Vector(1);
figura temp = new figura();
.... //more code....
i wanna save temp object in a file...
....//more code before this...
archivos.showSaveDialog(Main.this);
File archivo;
FileOutputStream archivo2 = null;
ObjectOutputStream obj = null;
archivo = archivos.getSelectedFile();
try{
archivo2 = new FileOutputStream(archivo.getAbsolutePath());
obj = new ObjectOutputStream(archivo2);
obj.writeObject(temp);
obj.close();
}
catch(Exception ex)
{
Throwable tro;
ex.printStackTrace();
tro=ex.getCause();
tro.getMessage();
}
...
and this is what i got:
java.io.NotSerializableException: paint.Main$1
..
..
and this:
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
...
..
Any ideas?

