posted 17 years ago
Hi experts,
I need to save information from a treeMap that has as a key a GregorianCalendar and as a value a vector of a certain object.
When I wanted to implements is, I got the following error:
Error: can not write to file!Error: can not write to file!Error: theBills.Bill
that is in fact an exception!!
Here are the pieces of codes that are related to saving data:
public void save(){
DAO.openOutput();
Set <GregorianCalendar> keys = bills.keySet();
Vector<Bill> vb;
for(GregorianCalendar key: keys){
vb = bills.get(key);
for(Bill b: vb)
DAO.WriteObject(b);
}
DAO.closeFile();
}
////////////////////////////////////////////
public void WriteObject(Bill b){
try{
//openOutput();
out.writeObject(b);
}catch(IOException e){
System.err.print("Error: can not write to file!");
}
}
////////////////////
What do you think the error might be??
PS: I have made all the classes in the project implement Seriliazable.
Thank u so much for your help!!!
Dounia