Hi, i want to open a htm file ,with an application in java.how can i do that?

Member Avatar for ztini
import java.io.IOException;

public class Open {
	
	public static void URL(String url) {
		try {
			Runtime.getRuntime().exec("rundll32 url.dll, FileProtocolHandler " + url);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
	public static void main(String[] args) {
		Open.URL("http://google.com");
	}
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.