0

In one of my java console application, I am dynamically creating html page. Now I want to open it using default web browser. So can you guys please help me out to solve it.

CrazyCoder
  • 2,465
  • 8
  • 36
  • 57

3 Answers3

2

Swing java.awt.Desktop.getDesktop().browse(uri);

SWT Program.launch(uri);

Taken from In Eclipse Plug-in, how to launch a web url using system broswer?

Assuming you have a file to open.

Community
  • 1
  • 1
Favonius
  • 13,959
  • 3
  • 55
  • 95
1

You should read Runtime it allows you to execute a launch of a program (your default browser for instance.

dom farr
  • 4,041
  • 4
  • 32
  • 38
0

With Java, your website is dynamic, so you need a server to run your web application. The most common one is Apache Tomcat. You should read about Tomcat if you plan to program websites with Java.

Jonathan Rioux
  • 1,067
  • 2
  • 14
  • 30
  • tomcat would be heavy for his task I'm sure that more lightweight servlet container exists for such task such as winstone http://en.wikipedia.org/wiki/Winstone_Servlet_Container or Jetty http://docs.codehaus.org/display/JETTY/Embedding+Jetty – dvhh Jan 10 '11 at 18:07