Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Help with serialization

  Asked By: Howard    Date: Mar 11    Category: Java    Views: 576
  

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);
}
}

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on Help with serialization Or get search suggestion and latest updates.




Tagged: