Solved

Open IE Window with options from a Java application

Posted on 2004-04-23
11
192 Views
Last Modified: 2010-05-18
Hello all,

I am looking for way to open an IE window with options (such as toolbar=1; width=n; etc.) from a Java application. I am aware of Runtime.getRuntime().exec(proccess, url), however IE has a limited choice of command-line parameters.

Thanks!
0
Comment
Question by:munting_monty
11 Comments
 
LVL 9

Expert Comment

by:mmuruganandam
ID: 10899712
String url = "http://www.ibm.com";
Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url);

0
 
LVL 9

Expert Comment

by:mmuruganandam
ID: 10899717
0
 
LVL 9

Expert Comment

by:mmuruganandam
ID: 10899756
class Launcher
{
  public Launcher()
  {
  }

 public void launch(String url)
 {
    Process p = Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url);
 }
}


Regards,
Muruga
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 14

Accepted Solution

by:
Tommy Braas earned 125 total points
ID: 10899803
Unless the browser supports specifyinf options via the AppletContext.showDocument(URL url, String target), there is no way. AFAIK IE does not support this, nor does any other browser on the market or the Java Plugin.

Furthermore, in order to be able to execute Runtime.exec() from inside an applet, the applet jar has to be signed or the security policy (a wholesale change) needs to be modified in order to allow this.
0
 
LVL 23

Expert Comment

by:rama_krishna580
ID: 10900481
try this...

Runtime.getRuntime().exec(new String[] {"/usr/mozilla/mozilla-bin", "file:///help.html"});    

OR

Runtime.getRuntime().exec(new String[] {"/usr/mozilla/mozilla-bin", "-remote", "openurl(file:///help.html)"});

or try this..

http://www.artima.com/legacy/answers/Oct2001/messages/146.html

best of luck..

R.K
0
 
LVL 7

Expert Comment

by:maheshexp
ID: 10901145
String url = "http://www.sun.com";
Runtime.getRuntime().exec("iexplore " + url);
0
 
LVL 92

Assisted Solution

by:objects
objects earned 125 total points
ID: 10905321
u could use exec and also use javascript in the html to set any options required.
0
 
LVL 14

Expert Comment

by:Tommy Braas
ID: 10915917
Finally someone else who actually read the question! Thanks Mick. ;-)
0
 
LVL 14

Expert Comment

by:Tommy Braas
ID: 11154297
Sounds good to me
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

Suggested Solutions

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

726 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