Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Executing the IE via Java 2

Status
Not open for further replies.

frag

Programmer
Dec 7, 2000
321
0
0
GB
Hi, this is frag again with another problem!

I have to accomplish the following task(s):
I'd like to have a pop-up-window in a java-application (like an alert box) but without the need of swing or awt if that's possible. The window should have some web-links which should open the IE and display a html-page when clicked.

Another solution would be to just call the IE from this application.

Does anyone has an idea how to do this?

thanx 'n' cya

frag

P.s.: Hope you understood my problem, cause my english is still bad as you can see / read. s-) patrick.metz@epost.de
 
Hi frag,
You can use the following code snippet to invoke IE from your application.
Runtime rt = Runtime.getRuntime();
rt.exec("C:\\Program Files\\Internet Explorer\\iexplore");
Hope this helps.

Regards,
Rajarajan
 
This works but it is not platform independant (i.e. Windows version). For example, my IE does not reside in that directory on Windows 98 but does on Windows 2000.

I've found the following call to be very Windows neutral (i.e. works with all versions):

String myurl = "rt.exec("rundll32 url.dll,FileProtocolHandler " + myurl);

See this link for more info:

 
And to open an empty page, you can have
String myurl="about:blank";

Regards,
Rajarajan
 
Ok, thanks a lot guys!
This one was very helpful... [thumbsup]

cya

frag patrick.metz@epost.de
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top