How to open an existing html file in java

hello everybody,

I have a problem with opening a html file through java.

I'm using java swing for my project. In that if i click a menu item the already existing html file must be opened. i'm not supposed to browse for the location where it has been store. For an end user we must provide the file as soon as the menu item is clicked.

Plz reply me

~regards

radha.srrini

[408 byte] By [radha.sun.250167.9994301413a] at [2007-11-26 16:03:57]
# 1
what does "open" mean in this context?
georgemca at 2007-7-8 22:25:51 > top of Java-index,Java Essentials,Java Programming...
# 2

Hi friend,

Here I attached the code to open the already existing notepad file. I think it will helpful to you....

import java.io.*;

import java.util.*;

class dynamic {

public static void main(String[] args){

try {

String input = "Hello World" ;

FileWriter fr = new FileWriter("output.txt");

if(input != null){

System.out.println(input);

fr.write(input);

}

fr.close();

Runtime r = Runtime.getRuntime();

Process p = null;

p = r.exec("notepad output.txt"); // This line is used open the purticular File. Inside the bracket you have to give command..

InputStream i = p.getInputStream();

System.out.println("i value:"+i);

}

catch (Exception e) {

System.out.println("Error executing notepad.");

}

}

}

Message was edited by:

ggopi

ggopia at 2007-7-8 22:25:51 > top of Java-index,Java Essentials,Java Programming...