change this
public static void addBall()throws IOException
{
Random generator = new Random();
Ball b = new Ball(100,100,8,Color.blue,generator.nextInt(4)+1,generator.nextInt(4)+1);
FileWriter fw = new FileWriter("C:\\temp_Jon\\BallData.ballz",true);
PrintWriter pw = new PrintWriter(fw,true);
pw.print(b.getX()+" "+b.getY()+" "+b.getRadius()+" "+b.color+" "+b.speedX+" "+b.speedY);
fw.close();
pw.close();
}
to
public static void addBall()
{
Random generator = new Random();
Ball b = new Ball(100,100,8,Color.blue,generator.nextInt(4)+1,generator.nextInt(4)+1);
try
{
FileWriter fw = new FileWriter("C:\\temp_Jon\\BallData.ballz",true);
PrintWriter pw = new PrintWriter(fw,true);
pw.print(b.getX()+" "+b.getY()+" "+b.getRadius()+" "+b.color+" "+b.speedX+" "+b.speedY);
fw.close();
pw.close();
}
catch(Exception e)
{
}
}
and see if it works