Control browser properties from a java application while launching a browse

How to control the properties of a browser when it is launched from a java application?
I am using the command " Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler "+url); " to launch the browser. The syntax of "exec" command is "public Process exec(String command,String[] envp) throws IOException". I would like to know whether we can give the arguments in this command to control the browser properties.
If you know any other option by which we can open a URL in a controlled browser, please share it.
Thanks in advance :).
Surekha_Venugopal

Hi All,
I have found a solution to control browser parameters from Java applications.
1. Create an intermediate HTML file at runtime which contains Javascript to launch a browser. Pass the parameters like the URL and browser control parameters to the Javascript of this HTML file.
2. Open this HTML file and invoke the javascript while loading the file. Javascript will launch the required URL in a controlled browser.
3. Close the intermediate HTML file.
Limitation:
1. There will be a flickering of windows.
2. Applets will have permission issues with the above solution. For applets a better solution is JSobject. No need of an intermediate file here.
Hope this will be useful for someone. :-)
Cheers,
Surekha_Venugopal

Similar Messages

  • How to open browser window from standalone Java Application???

    Is it possible to start Internet Explorer from non-applet application?

    Something like that could maybe help:
    Runtime.getRuntime.exec("iexplore http://www.google.com");
    but it's not platform independent + I couldn't let it work in that way. It only worked with Runtime.getRuntime.exec("c:\\windows\\....\\iexplore.exe http://www.google.com");
    But it's surely not platform independent.
    So the answer is in fact 'I don't know'.
    And if you ask why am I writing all that then, the answer is 'I don't know' too.
    And if you ask why...

  • Opening a new URL in an existing browser window from a Java application

    I've tried one of the many codes to open a new browser window and it works, but I need something else.
    Is there any way to open a new URL on the same window on a Java desktop application? (Changing the URL on the current browser window without opening a new one, I mean).

    You can do that by using an add-on such as:
    * NewTabURL - https://addons.mozilla.org/firefox/addon/newtaburl
    * New Tab Homepage - https://addons.mozilla.org/firefox/addon/new-tab-homepage
    Another way of opening the home page in a new tab is to middle click on the home button in the navigation toolbar.

  • Can we control the top level navigation in portal from a java application

    Hello,
    I am having a scenario where User logged in to portal and assigned with 2 roles (HOME , ISA(Java application)). When user opened a form in ISA (Java application) and tried to enter the data in form and moved to another tab (e.g. HOME) in top level navigation.
    When user come back to ISA (Java application) TAB , we show the page where he left earlier. I would like to know if user click any other TAB in top level navigation (Role assigned to him) while working on a page in ISA(Java application) is there any way we can catch that event before he leaves from ISA (Java application JSP page) to other TAB?
    How can we control the top level navigation events in the portal from a java application .Since Top level navigation is seperate par file.
    Thanks,
    RN

    Dear Rajesh,
    Top Level and detailed navigation values comes with iteration in the respective par file.
    Please check the par file and based on the value (i.e tab name) selected, you can write your code.
    Best Regards
    Arun Jaiswal

  • Attempting to launch a help browser from a java application

    I am currently investigating being able to view help html files through launching a browser from my Java application. I have come across the java.lang.Runtime and java.lang.Process classes which allow me to launch a browser like Netscape or Explorer and bring up a html file to view.
    What I want to do is launch the browser and bring up an html index file as well as the required html help file every time a user would like to use the help for my application.
    Is this possible using the other exec commands. If so, how? Is there somewhere I can find a user guide for Netscape and Explorer commands in order to send additional commands to the browser in order to do this.
    Thanks.

    Good news is it must be possible because VisualAge does it but I don't know how.

  • Launch a default web browser from my java application

    Hello,
    I have been trying to launch my default web browser from my java application, but am unable do it. Right now, I am using ---- "Runtime.getRuntime().exec("cmd /c start <url>"); to launch my webbrowser. It launches the browser but displays the command prompt for a second or so, and then replaces my already existing page with the new url.
    Is there any way for me to launch the url in a completely new browser each and every time. And I don't want the command prompt to show up for a sec. Please help...!
    Thanks in advance.
    -BusyBusyBee

    If by any chance your application is an Applet, you can use this to open a new browser window:
    getAppletContext().showDocument(new URL(theUrl), "_blank");
    But, you probably would have specified if that were the case. Oh well. Hope it helps someone!
    -sheepy.

  • Launching Java Application From A Java Application

    Hello,
    I am building a compiler and would like to have run feature. The problem is I can not seem to figure out the righ syntax to run and application from my java application.
    Here is the code I am using to run an application:
    public void RunClass()
    try
    Runtime rtr=Runtime.getRuntime();
    Process pr = rtr.exec("java " + CurrentDirectory + FileNoExt);
    String line;
    BufferedReader rerr = new BufferedReader(new InputStreamReader(pr.getErrorStream()));
    if((line = rerr.readLine()) == null) { CompileMessageArea.setText("Program Running\n"); }
    while ((line = rerr.readLine()) != null) { CompileMessageArea.append(line +"\n"); }
    rerr.close();
    catch(Exception re) { re.printStackTrace(); }
    The following is an example of what the above would send to the:
    java c:\MyJava\Programs\test
    If you try to type something like that in a DOS prompt it will not work. You must first change to that directory, but I am hoping there is an easy way to change the syntax. On the other hand if you want to compile a program you can type:
    javac c:\MyJava\Programs\test.java
    and it will work just fine. This is kind of funny and I use this syntax for my compiler in my program. You would think that the same syntax would work the same for both compiling and running but it does not. So, I know that if I just know what the correct syntax that dos would except for running an application it would work.
    So, if you have the answer for me PLEASE LET ME KNOW.
    It is easily testable by keying it into the dos prompt.
    Sincerely,
    Eric Kohr

    If you want to do it that way you need to use the environment parameter of the exec() method. Use it to set your classpath to the directory that's need for the java application you are about to run... for instance.
    String[] env = new String[] {"CLASSPATH=c:\classes"}
    String command = "java somePackage.someProgram";
    Runtime.getRuntime().exec( env, command);Where your program is in the file "c:\classes\somePackage\someProgram"
    your mileage may vary :)
    You can also reflectively load classes into the running VM and invoke their main methods. This give you the ablility to control them a bit more.

  • Displaying a URL from a Java application

    Hi,
    I recently implemented a test Java application based on Steven Spencer's Java Tip 66: "Control browsers from your Java application" (http://www.javaworld.com/javaworld/javatips/jw-javatip66.html). Spencer's example tests for the current operating system, sets some constants based on the OS that it finds, and then calls the Runtime.getRuntime( ).exec( ) method. During the call, you can pass either a file:// or http:// URL. I can get the example to work perfectly given a file:// URL but have limited success supplying the http:// URL. When I supply a specific http:// URL such as "http://someserver/somedir/testfile.htm" the browser returns a "Cannot open URL" error. However, if I supply a URL that does not resolve to a specific HTML file, such as "http://someserver/somedir", and the directory has either a "index.htm" or "index.html" file, the application works fine. I would like to be able to pass an http:// URL that resolves to a specific HTML file. I am trying to implement context-sensitive help from within a Java application. I am testing this on a machine running Windows 2000 and using Microsoft's IE 5.x browser. Any help would be appreciated.
    Thanks,
    Scott Rifenbark

    The browser doesn't know that it was started by this Java code, you know. So you are asking why your browser (Internet Explorer) doesn't let you get at specific files. The answer is, that isn't how the Internet works. A URL is a "Uniform Resource Locator" (or something a lot like that). It locates a resource on the Internet. This resource may or may not be a file, but as the client you have no way of knowing whether what you get in response to that is a file on the server or whether it has been generated by some CGI program there.
    When you send an http:// URL to a web server, it looks at what you have sent and goes through its configuration files. Using this it translates that URL into either a file on the server (which it returns to you) or a program which it calls to return data to you. If it was a file, its local name on the server doesn't have to be related in any way to the contents of the URL.
    It sounds like you are planning to be the one setting up those files on the server, though. If that's the case, you have to configure the server appropriately for your needs.

  • How do i Hyperlink to a web page from a java application?

    How do i Hyperlink to a web page from a java application using internet explorer as my default web browser?

    It's very simple.You can start any Application with the class Runtime. The command is an array consisting of the path of .exe and the file to be open.
    String [] cmd={path of IE+Filename.exe,"URL of your website"}
    try
    Runtime.getRuntime().exec(cmd);
    catch (Exception e)
    System.err.println(e.toString());
    }

  • Is it possible to run a java application within a web browser?

    Hello everyone here! I have a question about running a java application within a web browser and I would appreciate it very much if anyone here can give me some answers.
    I have a standalone java application written with AWT. Basically this free application lets users to select spectral lines from a big file based on some criteria and plot those selected lines. Yes, it is a very simple application. Now I want to run this application within a web browser so that users don't need to download the application from the ftp site and thus don't need to install in their machine. Is it possible to run this application within browser? If yes, can we get the same plotting function as we run the application separately and where should I start out?
    Thanks in advance!
    kuilian

    Please see the signed applet discussion group for details of how to avoid the applet security restrictions. You can sign the applet, or use the policy file containing {AllPermission} for testing purposes (though not suitable for widespread deployment).
    Regards
    Matthew

  • Manipulate Indesign cliente from a Java Application

    Hello, I need to manipulate Indesign client(open/close documents, create menus, tables, set colors etc... ) but I need to do that from a Java application. Is it possible? I was searching on google about it, even in Adobe's site, but the only way I found was thought Javascript, VbScript or AppleScript.
    Thanks in advance!
    Rafael

    I can control inDesign from Python or shell scripts on osx via `osascript` This is roughly how it works.
    My 'master' program runs shell command `osascript -e "tell Indesign blahblah end tell" /path/to/temporary.jsx`  
    `osascript` tells Indesign to execute "/path/to/temporary.jsx" as javascript
    If all goes well, the value of last expression  in .jsx is returned by `osascript` (serialised JSON works great for this)
    Sorry I'm vague on real life code, but this is my home machine so it's not in my reach.
    I realise it's an ugly hack. Main cons follow:
    quotes have to be escaped couple of times so the result is messy and prone to errors (luckily it's one-off code that sits hidden behind main interface)
    debugging this chain is nightmare (especially with my nigh-zero knowledge of applescript)
    so far it's mac only (I suspect same thing can be achieved on Windows machine with VBS)
    one cannot avoid writing lots of temporary files to the system. (luckily for me, it's only deployed on machines under my control, so the temp files are written to /tmp which is mounted on ramdisk)
    The only pro I can think of is that it works. Whole comlexicity is wrapped in one python module, which I only see when squashing the bugs.
    Marcel

  • How can i call a jasper report from a java Application

    Hi,
    i am chiranjit , currently i working in a web based ERP project, in this project as a report building tool we are using JasperReport wih eclipse plugin . in eclipse report's are generating very well but i am unable to call that report from a java application because i have no idea about the How to call a Jasper Report from a Java Application . so please send me the necessary class names, jar files names and programe code as early as possible.
    Chiranjit

    Ahh, kind of a duplicate thread:
    http://forums.java.sun.com/thread.jspa?threadID=631642
    @OP. You could have clarified your original post and the relationship of your question to java. You did not need a new thread.
    � {�                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How can i call a VB6 project from my java application using JNI

    hi
    can anyone tell me the procedure of calling a VB6 project from any java application using JNI
    if anyone does know then tell me the detail procedure of doing that. I know that i have to create a dll of that VB6 project then to call it from the java application.
    if anyone know that procedure of creating dll file of an existing VB6 project please reply
    please if anyone know then let me know

    Ahh, kind of a duplicate thread:
    http://forums.java.sun.com/thread.jspa?threadID=631642
    @OP. You could have clarified your original post and the relationship of your question to java. You did not need a new thread.
    � {�                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Calling a web service from a Java application

    Does anyone have sample code showing how to call a web service over from a Java application? I'm deploy to HP-UX and seeking out the most standard and reliable approach.
    Thank you in advance.

    Keith,
    Download JWSDP 1.2, look at the tutorial for JAXRPC, especially
    the client portion.

  • Getting Java Error while launching Juniper SBR from Mozila and IE

    Hi,
    I am getting the following error message on Java console while Launching SBR (Steel-Belted Radius).
    Here is the error:
    java.io.IOException: Cannot run program "C:\Documents": CreateProcess error=193, %1 is not a valid Win32 application
    Any help, will be greatly appreciated.
    Rohan

    Guys!!!!!!! Please help me out.......

Maybe you are looking for