I'm working on a sketch pad program in class and I'm adding save and
open options (it's not required but I'm bored). When I use the open
feature it just freezes up... do I need to dispose the JFileChooser?
Or am I just using the streams wrong?
JFileChooser chooser = new JFileChooser("G:\\Class Files\\AP
Computer Programming\\Etch n Sketch\\I our kewler tan adan\\Saved
Images");
int result = chooser.showOpenDialog(this);
if(result == JFileChooser.APPROVE_OPTION)
{
try
{
FileInputStream fis = new FileInputStream
(chooser.getSelectedFile());
ObjectInputStream objIs = new ObjectInputStream
(fis);
pane = new SketchPane((ArrayList) objIs.readObject
());
fis.close();
pane.repaint();
}
catch (NotSerializableException se)
{
System.err.println(se);
}
catch (FileNotFoundException fe)
{
System.err.println(fe);
}
catch (IOException se)
{
System.err.println(se);
}
catch (ClassNotFoundException ce)
{
System.err.println(ce);
}
}