This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes launch an application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "launch an application" Watch "launch an application" New topic
Author

launch an application

aude tantot
Ranch Hand

Joined: May 21, 2001
Posts: 39
Is it possible through my code to make a HTML doc appear in the user browser?
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Well, of course the obvious answer to that is yes. You are doing that right this second (check out the Location Bar).
The question is WHAT are you trying to accomplish, and from where.
Normally an Applet is embedded IN an HTML page, so apparently that is not what you are aking.
Any program can write out a file that has Strings in it that just happen to be HTML code. A java program can launch another program, say for instance a browser, and feed it a parameter, which just happens to be an HTML file, and that would cause the HTML doc to appear in the browser. But of course that would be a SEPARATE window and function from the java program / applet that invoked it.
It is possible to point a URL at an HTML file and "invoke" it that way also.

I am not really sure from your question WHAT it is that you are trying to accomplish.


"JavaRanch, where the deer and the Certified play" - David O'Meara
aude tantot
Ranch Hand

Joined: May 21, 2001
Posts: 39
In fact, i've an application which generate a HTML document. Iwould like this doc to be displayed after its creation.
Joel Cochran
Ranch Hand

Joined: Mar 23, 2001
Posts: 301
I hope this partial answer will help... I do the same basic thing from an AS/400 to the users current browser. You need to execute a system command like so: "START urlpath/filename.html". From what I've been reading here at the Ranch, you can do stuff like this by executing a runTime() method, but I don't know the implementation details. If you create the file on the fly, then you know the path and name, so I would think that you would be able to build the appropriate String and send the String to the System Command.
Let us know when you have it ironed out!
------------------
I'm a soldier in the NetScape Wars...
Joel


Wait a minute, I'm trying to think of something clever to say...<p>Joel
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: launch an application