Duke Dollars! worked all day, then threw an IOException
I've been working on this program for a few weeks on my iMac, my G5, and my friend's Pentium 4. It's been fine on all of the computers until this evening, when it threw an IOException and brought up the dialog box from the catch block on both my macs. I don't know whether it did the same thing on the PC or not. As far as I know, nothing has changed in the codethat would affect this.
The file that is being read is created in another program. The program that creates the file seems to be working fine.
Code for program that makes file:
import java.io.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.text.*;
import java.util.*;
publicclass optimizedMatchSwingDataImportextends JFrameimplements ActionListener{
//Declare output stream
DataOutputStream output;
//Get the current date, construct, and open the file
Date today =new Date();
SimpleDateFormat myFormat =new SimpleDateFormat("MMddyyyy");
String filename ="data" + myFormat.format(today);
try{
output =new DataOutputStream(new FileOutputStream(filename));
}
catch(IOException io){
JOptionPane.showMessageDialog(null,"The program could not create a
storage location. Please check the disk drive and then run the program
again.", "Error", JOptionPane.INFORMATION_MESSAGE);
System.exit(1);
}
....
Code for program that inputs file:
//This class will import data from a file, implement the graph, and find the max matches.
import edu.uci.ics.jung.graph.impl.*;
import edu.uci.ics.jung.graph.*;
import java.io.*;
import javax.swing.*;
import java.text.*;
import java.util.*;
import edu.uci.ics.jung.graph.predicates.*;
import gabl.alg.matching.*;
import gabl.graph.impl.*;
import gabl.graph.EdgeIterator;
publicclass optimizedMatchMain{
publicstaticvoid main(String[] args){
DataInputStream input;
Graph gFirst =new UndirectedSparseGraph();
//FileNotFoundException() bug workaround from
//http://forum.java.sun.com/thread.jspa?threadID=478467
System.setProperty("user.timezone","UTC");
TimeZone.setDefault(new SimpleTimeZone(0,"UTC"));
//Get the current date, construct the input stream, and open the file
Date today =new Date();
SimpleDateFormat myFormat =new SimpleDateFormat("MMddyyyy");
String filename ="data" + myFormat.format(today);
try{
input =new DataInputStream(new FileInputStream(filename));
//Read data from file, construct pair vertices, and add to gFirst
addVertices(gFirst, input);
}
catch(IOException io){
JOptionPane.showMessageDialog(null,"The program could not access a
storage location. Please check the disk drive and then run the program
again.", "Error", JOptionPane.INFORMATION_MESSAGE);
System.exit(1);
}
...
Please help me asap. I really don't understand how the program could work all day and then just freak out on me.

