Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

I accidentaly the whole applet

Name: GlacialEntropy 2009-07-13 2:23


public String readFile(File aFile) {
           
            StringBuilder contents = new StringBuilder();
           
            try {
             
              BufferedReader input =  new BufferedReader(new FileReader(aFile));
              try {
                String line = null;
               
                while (( line = input.readLine()) != null){
                  contents.append(line);
                  contents.append(System.getProperty("line.separator"));
                }
              }
              finally {
                input.close();
              }
            }
            catch (Exception ex){
              ex.printStackTrace();
            }
            System.out.println(contents.toString());
            return contents.toString();
          }

This compiles and runs properly in any IDE, but it throws security exceptions when I put it into an html file with this code:

<applet code =
"uniSim.class" width = 800 height =
600></applet>

Is this bad?

Name: Anonymous 2009-07-13 12:52

>>3
No, my applet reads files not writes them. It inputs data from a file if the user so needs it. Im about to attempt FVs suggestion.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List