views:

20

answers:

1

I tried this, but without sucess:

         File temp = File.createTempFile("document", ".htm");

         BufferedWriter out = new BufferedWriter(new FileWriter(temp));
         out.write("hi !!!"); 
         out.close();

         System.out.println(temp.toURI().toString());


         java.awt.Desktop.getDesktop().browse(temp.toURI());
A: 

Works for me in slightly modified form:

    File temp;
    try {
        temp = File.createTempFile("document", ".htm");
        BufferedWriter out = new BufferedWriter(new FileWriter(temp));
        out.write("hi !!!");
        out.close();

        System.out.println(temp.toURI().toString());

        java.awt.Desktop.getDesktop().browse(temp.toURI());
    } catch (IOException e) {
        e.printStackTrace();
    }
eugener
i dont believe that just put try catch to works !!!Thanks !
celsowm