I have a japplet program, and i need it to take a hashmap and write it to a file (plain text file works). I am using bufferedwriter and filewriter, but the japplet hangs when that line is executed. does anyone know why???
here is my code:
try
{
File outputFile = new File(filename);
BufferedWriter emplFile = new BufferedWriter(new FileWriter(outputFile, false));
for(Iterator i = emplMap.keySet().iterator(); i.hasNext(); )
{
Object key = i.next();
Employee tempEmpl = (Employee)emplMap.get(key);
emplFile.write(data + '\n');
}
emplFile.close();
}
catch(IOException ioe)
{
JOptionPane.showMessageDialog(null, "IOException", "Error", JOptionPane.ERROR_MESSAGE);
}
I am writing a real qiuck prototype for my boss, and i am a bit on the line. any help would be appreciated
here is my code:
try
{
File outputFile = new File(filename);
BufferedWriter emplFile = new BufferedWriter(new FileWriter(outputFile, false));
for(Iterator i = emplMap.keySet().iterator(); i.hasNext(); )
{
Object key = i.next();
Employee tempEmpl = (Employee)emplMap.get(key);
emplFile.write(data + '\n');
}
emplFile.close();
}
catch(IOException ioe)
{
JOptionPane.showMessageDialog(null, "IOException", "Error", JOptionPane.ERROR_MESSAGE);
}
I am writing a real qiuck prototype for my boss, and i am a bit on the line. any help would be appreciated