Closing browser from a java application

I have an applet having a button Save on it. I am calling a javascript function of closing the browser. But if i click it, a built in message comes to confirm the closing of browser having two opitons Yes and No. Is there any possibility that the browser closes without showing this message?

May this is the wrong forum to post this message. However you could avoid that close-dialog by setting an opener
  function closeWindow() {
    window.opener="x";
    window.close();
  }So you can fake an self-opened window.
The behaviour depends on used browser. So this should work for IE and Opera but not for Netscape...
br
karl

Similar Messages

  • 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.

  • Open default browser from a java application

    How is possible to make a java application that open an html file in the default browser ?
    Thankyou
    [email protected]

    You can do that by running the command "start <url>", for example using Runtime.exec().
    Runtime.getRuntime().exec("start http://java.sun.com");Jesper

  • Open URL in Web Browser from a Java Application

    Hi,
    I have an HTML document that I want to load in a browser window by clicking on a button in my java GUI application.
    Any suggestions?
    Thanks.

    You can use the Process class to start the web browser with the proper command line arguments (depends on the web browser though). Or on windows, you can have your program create a batch file with the code start url (where [url] is your url), and this will open the default web browser when run (again you must run it with a Process).

  • How can I launch a web browser from my Java application?

    I've reed about this at Question of the Week (http://developer.java.sun.com/developer/qow/archive/15/index.html). It doesn't work for me. I'm running win2000 and trying:
    try {
    Runtime.getRuntime().exec("start iexplore http://java.sun.com");
    } catch (Exception e) {
    System.out.println( e.getMessage() );
    I get:
    CreateProcess: start iexplore http://java.sun.com error=2
    What's wrong?

    This function will launch the default browser under Windows.
    public static void displayURL(String url) throws IOException   {
        String cmd = null;
        Process p;
        try  {
            String os = System.getProperty("os.name");     
            if (os != null && os.startsWith("Windows")) {
                if (os.startsWith("Windows 9") || os.startsWith("Windows Me"))  // Windows 9x/Me
                    cmd = "start " + url;
                else // Windows NT/2000/XP
                    cmd = "cmd /c start " + url;
                p = Runtime.getRuntime().exec(cmd);     
        catch(IOException x)        {
            // couldn't exec browser
            System.err.println("Could not invoke browser, command=" + cmd);

  • Launching a Browser from a Java Application

    I want to open an HTML page in the "default" browser. I know how to run commands so I could open IE or Netscape but I want to open a browser without having to know what browser they have installed. It would be nice if there is something that isn't platform dependent. Is this possible?

    It would be nice if there is something that isn't platform dependent. So you've seen the java tip
    http://www.javaworld.com/javaworld/javatips/jw-javatip66.html
    I don't think it's that easy to do what you want so that it is portable... sad that the current API doesn't have great support for programs written in other languages than Java.

  • 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

  • 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());
    }

  • 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 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.

  • How to call pdf forms developed in ABAP from WD Java application?

    Hi
    I have a web dynpro ABAP application that that is responsible for generating PDF forms for all other applications (WD ABAP and WD Java).
    How can I call the pdf forms generated by the WD ABAP application from WD Java application in a separate window?
    These forms are to be called on click of a "Print" button. Also, these forms are non interactive.
    Kindly let me know if you need any other information.
    Regards
    Vineet Vikram
    Edited by: vineet vikram on Jun 24, 2009 7:28 AM

    in addtion to Nikhil's response. you can write following code on action of print button:
        IWDWindow window = wdComponentAPI.
            getWindowManager().createExternalWindow(
                  "<ABAP Application URL>",
                  "<Title for window>",
                  false);
       window.open();
    to Close the application, you can use the window close or u can fire an event to close current window.
    Abhinav

  • Create a browser in a java application

    Hello everybody, I need yor help, I need make a little browser in a java application.
    I have a JComboBox whith filesystem roots like items(I used File ListRoots()), and I need to appear the directories in a Jtree, and I do not know how can I make that, please help me......thanks a lot

    I'm new in java programig this is the first
    application that I do, really I need help...thanksIf you have never written a Java program before then you have chosen a difficult task. What you should do next is: stop asking questions here. You do not understand the answers you are getting because you do not have the background knowledge to understand them. Instead, read those tutorials that you have been referred to. You will not understand them either, but that is normal too. Try the examples they contain. Once you have them working, try changing them to do something else.
    If you need basic Java training, read more of the Java tutorials you will find here:http://java.sun.com/docs/books/tutorial/But remember, you cannot learn Java or any other language by asking people one question at a time.

Maybe you are looking for

  • Java.io.StreamCorruptedException: invalid stream header

    I am having a problem with sending two objects (over a socket). I have read in other posts that this could be due to trying to receive incompatible data types but my applications work fine if I send my objects synchronously rather than asynchronously

  • Qosmio x770-136 Dual band wifi 2.4 and 5ghz - how to switch between them?

    Hi Guys, getting a new router netgear dual band N900, and it supports multi 2.4-5ghz wifi, my question is how to i set my qosmio up at 5ghz? thanks for any replies

  • TS1441 ipod doesn't show up in itunes or even in my disc utility..

    So I have an Ipod classic 160gb and the "Use itunes to Resore" picture showed up on my screen.  When i plugged it into my laptop the device didn't show up in my itunes or even on my laptop.  The ipod's screen is frozen and reads "do not disconnect". 

  • Lightroom 2, Keywording and searching

    I am not sure if I am missing a step... but when I started updating keywords some older photos. I placed in Zoo Atlanta, Zoo, and Apes. I synched the keywords and tried to use the search feature. TEXT - ANY SEARCHABLE FIELD - CONTAINS ALL and then I

  • Pipelined function which creates xml nodes,items and elements

    Hi Everyone, I am Vikas Kumar and i have written a pipelined function which is returning a UDT which i have created in my database. but when i am piping a row then there is error : "Error: PLS-00306: wrong number or types of arguments in call to 'CLA