Solved

Open IE Window with options from a Java application

Posted on 2004-04-23
11
179 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
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Java Jpanels and Jframe 8 33
Java Options in Zimbra Server 2 54
egit plugin on eclipse 8 64
hibernate example using maven 12 42
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 Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…

803 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