I am trying to build a java applet which downloads a file to the client machine. As a java application this code worked fine but when I tried as an applet it does nothing. I
FileOutputStream fos = new FileOutputStream("google.html");
Change that to:
File userHome = new File(System.getProperty("user.home"));
File pageOutput = new File(userHome, "google.html");
FileOutputStream fos = new FileOutputStream(pageOutput); //see alternative below
Ideally you would put the output in either of:
user.home. user.home is a place where the user is supposed to be able to read & create files. JFileChooser.