Solved

Open IE Window with options from a Java application

Posted on 2004-04-23
11
160 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
 
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
countPairs challenge 7 58
strDist challenge 35 84
Python Assistance 7 36
advertisement module in core php 4 89
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

760 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now