This is what I have for my code and its not working. Does anyone see anything wrong with this:
String fn=JOptionPane.showInputDialog("Please enter the name that you wish to save the database as.");
File file=new File(fn);
try{
file.createNewFile();
} catch (Exception e){
JOptionPane.showMessageDialog(null, e);
}
try{
oos = new ObjectOutputStream(new FileOutputStream(file));
oos.writeObject(cdc);
} catch(Exception e){
JOptionPane.showMessageDialog(null, e);
}
try{
oos.close();
} catch (Exception e){
JOptionPane.showMessageDialog(null, e);
}
}