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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
} } ) ;

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sciuriwareCommented:
Is your HELP too complex to display it in your own JEditorPane, as part of the application?

;JOOP!
Mayank SAssociate Director - Product EngineeringCommented:
Maybe, split.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.