[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Dealing with default browser

Posted on 2006-04-16
5
Medium Priority
?
168 Views
Last Modified: 2012-03-15
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)

0
Comment
Question by:MichaelRubinshteyn
  • 2
3 Comments
 
LVL 30

Accepted Solution

by:
Mayank S earned 500 total points
ID: 16467139
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
 
LVL 24

Expert Comment

by:sciuriware
ID: 16467200
Is your HELP too complex to display it in your own JEditorPane, as part of the application?

;JOOP!
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 16760347
Maybe, split.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month20 days, 5 hours left to enroll

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question