Dealing with default browser

In our application, written in Java,
we launch Help System as .html file using default system browser.
The code used:
 Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url);

There are two problems with this code that we don't know how to solve.
1. Each time Help is Launched, new browser window is opened.
We would like each subsequent help topic to go to the same browser window
if it is opened already.

2. We would like to close browser window with the Help Topic upon
closing our application.

Any suggestions are appreciated.  (michael)

MichaelRubinshteynAsked:
Who is Participating?
 
Mayank SAssociate Director - Product EngineeringCommented:
Not sure if you can do this without JNI.

>> Each time Help is Launched, new browser window is opened.

Check if there is a browser option which allows you to open it in the same window. In IE, try Tools -> Internet Options -> Advanced -> Browsing -> Re-use windows for launching short-cuts

Not sure if it would work though....

>> We would like to close browser window with the Help Topic upon closing our application.

Keep a handle to the process like: Process p = Runtime.getRuntime ().exec (....) ; You will need to add a shut-down hook to your application. Runtime.getRuntime ().addShutdownHook ( new Thread () { public void run () { // here terminate the process
} } ) ;
0
 
sciuriwareCommented:
Is your HELP too complex to display it in your own JEditorPane, as part of the application?

;JOOP!
0
 
Mayank SAssociate Director - Product EngineeringCommented:
Maybe, split.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.