How to close the browser from an Applet?

Hi,
I've written one applet, with 2 buttons (Continue & Exit). On click of Continue button, it will open another web page. On click of Exit button, the browser should be closed.
I'm not able to close the browser from the applet.
Can any body help me.
Rgds
Santosh

In my experience, calling Javascript from applets is flaky at best. However, I have gotten it to work in some cases. The following code should get you started:
netscape.javascript.JSObject win = netscape.javascript.JSObject.getWindow(applet);
Now you can call different methods on the win object (look into Javascript documentation for details).
It also depends on if you are using the Java Plug-in or the JVM built into the web browser. You probably need set MAYSCRIPT=TRUE in your HTML. Look into the Java Plug-in documentation for details...

Similar Messages

  • How to close the browser from webdynpro application

    Hi All,
    I need  to implement the closing the browser where the webdynpro  application running by click on some button in that application.
    Can any body tell me how to implement that.
    Regards
    Vijay

    Hi,
    I resolved as follows(WebDynpro7.3) :
    1.- Create a plug in the "Window" with the name "Exit" and parameter "closeWindow" the type Boolean, after edit it and put type Exit.
    2.-Repeat the same but in the "Interface".
    3.-Place the following code in the action:
      IWDWindowController iwdWindowController =wdControllerAPI.getWindowController();
      IWDWindowInfo windowInfo=iwdWindowController.getWindowInfo();
      IWDOutboundPlugInfo  iwdOutboundPlugInfo=windowInfo.findInOutboundPlugs("Exit");
      iwdWindowController.firePlug(iwdOutboundPlugInfo, new HashMap(){{put("closeWindow",true);}});
    regards.
    JCARMONA

  • How to stop the Browser from caching my web pages

    Hi There
    Can anyone tell how to stop the browser from caching my jsp pages
    I am using
    <%response.setHeader("Cache-Control","no-cache");
    response.setHeader("Pragma","no-cache");
    response.setDateHeader ("Expires", 0);
    %>
    but this does not work anduser is able to go back to the previous page
    which i dont want and i want the browser to display the message the page has expired
    Help appreciated
    Thanks
    Mumtaz

    response.setHeader("Cache-Control", "no-cache");
    response.setHeader("Pragma", "no-cache");
    response.setDateHeader("max-age", 0);
    response.setDateHeader("Expires", 0);
    I have cut paste the code from my jsp which is working. There is one additional line. I do not know if that is the cause but there is no harm in trying that out.
    Srinivasan Ranganathan

  • How to close the browser on button click?

    Hi,
    On a HTML page, I have a button labeled as "Close". When user click the button, I want to close the browser. I am using Apex 4 with 10g.
    I created the following process which I call on pressing the close button:
    BEGIN
    htp.p('<body>');
    htp.p('<script type="text/javascript">');
    --htp.p('window.opener.doSubmit();');
    htp.p('window.close();');
    htp.p('</script>');
    htp.p('</body>');
    END;But it shows the below in the browser instead of closing it.
    Location: f?p=17638:9:3591448756041585::NO
    Any wayout?
    Thx

    For popup windows I use button code / javascript such as this.
    The self function refere to the correct window, while window.close my be connected to the wrong (parent) window.
    input type="button" value="Cancel" onclick="self.close();"  id="CANCEL"Edited by: Sven W. on May 26, 2011 2:46 PM

  • How to prevent the browser from executing the old version of js file...

    Dear sirs,
    I have a JSP page that includes a javascript file as given below,
    <script type="text/javascript" src="../scripts/validation.js"></script>
    Some times modification is needed in this included script file. After the modification, when I load the JSP page in the browser,
    the old copy of the script file, which was not modified is getting executed. by the browser.
    I would like to know whether any options are availabe in javascript to prevent the browser from executing the old copy that has already downloaded to the temperary interner folder(from caching)and use the modified version available with the new response...
    Thank you,
    Sudheesh K S

    Dear sir,
    Thakyou very much for your comment.
    I tried this, By doing thisThe .html page of the response will be deleted. But the javascript file will not be removed. It will be remail there.
    This lead me to the idea to think about javascript. I heard that some commands are there in javascript like cache ="NO" but not sure. I searched in the net but no favourable result found...
    Thank you,
    Sudheesh....

  • How to call URL in background or close the browser from ABAP

    Requirement changed.. no longer an issue. Thanks.
    Message was edited by:
            Atul Devasthali

    Hi He,
    This question has been asked (and answered) many times in this forum.
    Please do a search for words like "InitialContext", "RMIInitialContextFactory",
    and "weblogic". You will find lots of information.
    Also, the following web page has links to documentation, "how-tos"
    and sample code:
    http://otn.oracle.com/tech/java/oc4j/content.html
    Have you looked at it?
    Good Luck,
    Avi.

  • Show Confirmaiton Dialog when user closes the browser

    Hello All,
    Can we show a confirmation dialog when user chooses to close the browser in which applet is running? I know that it can be done using javascript. Can it be done using java code?
    Please suggest.
    Thank you.

    teejrama wrote:
    ..Can we show a confirmation dialog when user chooses to close the browser in which applet is running?.. You can pop a JOptionPane in the applet's destroy() method, but that will not do any good, since the browser is not asking the applet for advice on whether it is closing, it is telling the applet it is closing.
    ..I know that it can be done using javascript... Can it? How?
    If so, that would be another good reason to disable JS.
    ..Please suggest.I suggest you presume the end-user is smart enough to know when they want to close their own browser, and not interfere in that process.
    Thank you.No worries.

  • How to disable the "close" option of the Explorer from an applet

    Hi, i'm developing a little applet an i would like to know if it is posible to disable the options of maximize, minimize and close of the Internet Explorer from the applet code. If it is posible how?
    Thanks.

    If you disable the close funstion, the user would need to reboot their machine to close the browser. Even if it is possible, it seems dangerous.

  • How the system automatically kills the process when I close the browser?

    Hi everybody,
    I have the following problem: I run a report on the web browser. Suppose the user want to detail on one of the characteristics of report. If this takes long time (there are many records in report) and the user closes the web browser, the SAP system still run the proccess (in SM50 I see the dialog process still working, althrough the user closes the browser). This didn't happen in Excel, means, if the user press the 'Cancel' button when he/she tried to detail on one characteristic, the corresponding process is killed too (I see in SM50 how the corresponding dialog process is removed).
    How can I solve this ? Any idea about this?
    Thanks in advance.
    Florina

    Florina,
    there is a timeout set for the web session and the session would get automatically terminated after some time ..
    Some options are :
    1. Use Stateless Templates
    2. There is a Web Template setting called "Automatic Session Management" which uses a page wrapper cookie and kills the session when the person navigates from the page.. - <b>have changed it from previous answer after seeing Anil's post - apologies</b>
    3. If you are using EP  , you could implement DSM Terminator for the same.
    All the above( except 3) will not be suitable for stateful templates , if you want export to excel capability , or printing capability or the capability to save the pages as HTML for local use , you have to use stateful templates.
    First you would have to decide whether to use statefull or stateless templates and then depending on the choice made , go for any of the above. In case non of them work out for you , there is another option , but that would include a lot of javascript and using some command line parameters , update this post and I can tel you about the other if required..
    Hope it helps..
    Arun
    Assign points if useful
    Message was edited by: Arun Varadarajan

  • How do I customize the "Navigation Tool Bar" by adding the print ICON so that the ICON will remain when I close the browser?

    I have tried SEVERAL times to customize the "Navigation Tool Bar" by adding the print ICON. Every time I do this it works until I close the browser then I have to re-add the ICON the next time I open the browser. How do I make the ICON stay from session to session?

    See [[toolbar keeps resetting]].

  • When I close the browser, firefox won't open again. I get the message "Firefox is still running, restart your computer." How do I fix this?

    When I close the Firefox browser by clicking on the X in the upper right-hand corner of the screen, the window closes. But when I want to open Firefox again, I cannot. Instead, I get a message, "Firefox is still running. Restart your computer." This happens a few times a week and is very disconcerting. How do I fix this problem?

    I will only close the browser by using your suggestion, File > Exit, from today on, and see what happens. Thank you for your expedient reply.

  • When I have the downloads window open and I close the browser window, how can I get the browser to open the homepage the next time I start it while the download window is still open?

    When I have the downloads window open and I close the browser window, the next time I reopen the browser while the downloads are still going, it returns me to the last page I was on. All previous versions of Firefox would return me to my homepage which I would prefer. Please let me know if this is possible.

    When you re-open Firefox and choose Restore Session, by default it picks up your most-recently-open window, and the other windows should then show up in Recently Closed Windows.
    The Firefox add-on Session Manager lets you manage how many closed windows and closed tabs are saved, in case it's not enough.

  • How to set a cookie in the browser from an html page called via an Iview

    How to set a cookie in the browser from an html page called via an Iview
    Hello all,
    I have an issue which is causing problems. I have a snap survey (html form with submit and cookie setting) which is embedded in a url iview.
    Although the submit and the form work fine, the portal will not allow the cookie to be set it seems.
    Is there a way to allow cookies to be set from an embedded page in a url iview??
    You will make my day if you know!
    System: EP7 SP13
    Kind regards
    Alex

    Hi,
    Check this:
    http://www.oracle.com/technology/products/ias/portal/html/same_cookie_domain_with_pdkv2.html
    Cookie Basics
    Web browsers have built in rules for receiving and sending cookies. When a browser makes a request to a web server and the web server returns cookies with the response, the browser will only accept a cookie if the domain associated with the cookie matches that of the original request. Similarly, when a browser makes a subsequent request, it will only send those cookies whose domain matches that of the target web server.
    These rules are designed to ensure that information encoded in cookies is only "seen" by the web server(s) that the originator of the cookie intended. These rules also ensure that the cookie cannot be corrupted or imitated by another server. By default, the domain associated with a cookie exactly matches that of the server that created it. However, it is possible to modify the domain at the time the cookie is created. Relaxing the cookie domain increases the scope of the cookie's visibility making it available to a wider "audience" of web servers.
    For example, if a cookie is created by a.us.oracle.com, it's domain will usually be set to a.us.oracle.com. This means that the browser will only send the cookie to a.us.oracle.com. It will never send it to any other servers. However, if at the time of creation, the domain of the cookie is set to .us.oracle.com, the browser will send the cookie to any server whose domain falls within .us.oracle.com. such as portal.us.oracle.com, provider.us.oracle.com, app.us.oracle.com etc
    Regards,
    Praveen Gudapati

  • When I click on a link, tabs open continuously and rapidly until I close the browser. How do I stop it?

    Every time I click on a link, multiple tabs open rapidly, one after another, until I close the browser. This does not happen when I use Internet Explorer.
    == This happened ==
    Every time Firefox opened

    Firefox includes options of how to handle different content types, in your case the mailto links are probably set to "Use Firefox". For details of how to fix this see [[Firefox keeps opening many tabs or windows]], in particular the section "Change the action for a content type".

  • Safari status bar disappears.  I have tried clicking on show status bar and it will only appear when I move the cursor to the top of the screen.  I can not minimize the open page only full screen or close the browser.  Any idea how the rectify this

    Safari status bar disappears. I have tried clicking on show status bar, under the View tab and it will only appear when I move the cursor to the top of the screen. I can not minimize the open page, only full screen or close the browser. Any idea how the rectify this issue?

    One enters and exits full-screen with control+command+F keys. This is on the View menu in Safari. Optionally, the green traffic light in your browser title bar, if you roll over it, has the full-screen control it it. While in full-screen mode with Safari, moving your mouse pointer virtually up, and off-screen reveals the Safari title bar again, and you can click the green traffic light to exit full-screen mode.
    You can hide/show the status bar by simply typing command+/. This too, is on the Safari View menu. and in 10.10.1 — it works reliably for me.

Maybe you are looking for