Closing Web Browser from an Applet

Does anyone knows how to close the Web Browser from an Applet ?
Also Is there a way to close a browser which is intantiated from using ApplteContext ().showDocument ("....","_Blank").
Thanks
Sohan

Hi kavinjir!
Using class netscape.javascript.JSObject is possible to interact with javascript which can easily close the window browser but I'm afraid about the newest one because it isn't a child window. If this newest window contains an applet both (applets) can interact and send/receive "messages" to trigger an event (e.g; close via javascript again).
Best Regards.

Similar Messages

  • Can you disable the status bar on a web browser from an applet?

    I have a signed applet and am using plugin 1.3.1_02 with IE 5.5. I use the showStatus("text") method to display pertinent information to the user in the browser's status bar.
    Currently I see all types of messages being displayed (in IE's status bar) as my applet communicates with the server. I would like to restrict what is shown in the status bar to show my system messages only.
    Can I filter what is displayed or disable status bar functionality programmatically from the applet? Or possibly with a browser/plugin setting?
    Thanks

    Hi,
    I think you can do that with Java to JavaScript communication.
    thanks,
    Srinivas.

  • Closing web browser from a Web Dynpro (ABAP) component in it

    Hi,
    I am opening a Web Dynpro component in IE.
    I have a requirement to close the Internet Explorer window on click of a "Close" Button in Web Dynpro (ABAP) component. I am using EXIT Outbound plug of the Main Window to perform the same.
    In the EXIT plug I am setting "CLOSE_WINDOW" parameter to ABAP_TRUE.
    On click of the "Close" button a pop-up dialog box (with "Yes" and "No" buttons) appears asking me whether I really want to close the IE window.
    If I click on "Yes" button of the dialog box, the IE window gets closed without any issues.
    But when I click on "No" button, the IE window shows up a blank screen. I want the control to come back to the calling Web Dynpro component's screen.
    Appreciate any help/guidance in the above issue.
    Thanks,
    Prasanna

    create an action 'YES','NO', 'CANCEL' in required view.
    copy and paste below code in YES action
    method ONACTIONYES .
      data : l_view_cntr type ref to if_wd_view_controller,
    l_win_cntr type ref to if_wd_window_controller,
    l_window type ref to if_wd_window,
    l_parameter_list type wdr_event_parameter_list,
    l_parameter type wdr_event_parameter,
    l_val type ref to data.
    field-symbols <fs> type any.
    l_view_cntr = wd_this->wd_get_api( ).
    l_win_cntr = l_view_cntr->get_embedding_window_ctlr( ).
    l_parameter-name = 'CLOSE_WINDOW'."'CLOSE_WINDOW'.
    create data l_val type c.
    assign l_val->* to <fs>.
    <fs> = 'X'.
    l_parameter-value = l_val.
    insert l_parameter into table l_parameter_list.
    l_win_cntr->if_wd_view_controller~fire_plug(
    exporting plug_name = 'EXIT_PLUG'
    parameters = l_parameter_list ).
    endmethod.
    goto your window
    create plug EXIT in Window of type EXIT and chect interface checkbox
    create a button - for example - "PUSH BUTTON"
    in pushbutton action
    copy and paste this code
    method ONACTIONEXIT_PLG .
    DATA: API TYPE REF TO IF_WD_COMPONENT,
          WINMAN TYPE REF TO IF_WD_WINDOW_MANAGER,
          WIN TYPE REF TO IF_WD_WINDOW,
          TEXT1 TYPE STRING_TABLE,
          ls_text type string,
          V_API TYPE REF TO IF_WD_VIEW_CONTROLLER.
    API = WD_COMP_CONTROLLER->WD_GET_API( ).
    WINMAN = API->GET_WINDOW_MANAGER( ).
    LS_TEXT = 'Do You Want To Close the Window'.
    INSERT LS_tEXT into table text1.
    win = winman->create_popup_to_confirm(
                                           window_title = 'CONFIRM'
                                           text = text1
                                           button_kind = if_wd_window=>co_buttons_yesnocancel
                                           message_type = if_wd_window=>co_msg_type_question
                                           window_position = if_wd_window=>co_center ).
    V_API = WD_THIS->WD_GET_API( ).
    WIN->SUBSCRIBE_TO_BUTTON_EVENT(
            BUTTON = IF_WD_WINDOW=>CO_BUTTON_YES
            ACTION_NAME = 'YES'
            ACTION_VIEW = V_API
            IS_DEFAULT_BUTTON = ABAP_TRUE ).
    WIN->SUBSCRIBE_TO_BUTTON_EVENT(
            BUTTON = IF_WD_WINDOW=>CO_BUTTON_NO
            ACTION_NAME = 'NO'
            ACTION_VIEW = V_API
            IS_DEFAULT_BUTTON = ABAP_FALSE ).
    WIN->SUBSCRIBE_TO_BUTTON_EVENT(
            BUTTON = IF_WD_WINDOW=>CO_BUTTON_CANCEL
            ACTION_NAME = 'CANCEL'
            ACTION_VIEW = V_API
            IS_DEFAULT_BUTTON = ABAP_FALSE ).
    WIN->OPEN( ).
    endmethod.

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

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

  • Opening a browser from an applet

    I got a problem, I want to open a browser from my applet, but I just found one way:
    getAppletContext().showDocument(new URL(
    "http://www.java.sun.com"), "_blank");
    but the problem is: with this, the default browser with defaul settings is opened, and that's what I don't want...
    how can I open the browser with some settings (for example size, or no-url-bar, etc)
    thx for help

    hi,
    try this code:
    public void showDocument(java.net.URL url, String targetWindow)
    when targetWindow can be:
    "_blank" Display the document in a new, nameless window.
    "windowName" Display the document in a window named windowName. This window is created if necessary.
    "_self" Display the document in the window and frame that contain the applet.
    "_parent" Display the document in the applet's window but in the parent frame of the applet's frame. If the applet frame has no parent frame, this acts the same as "_self".
    "_top" Display the document in the applet's window but in the top-level frame. If the applet's frame is the top-level frame, this acts the same as "_self".

  • Xmonad - prevent web browser from going "fullscreen"

    Hi,
    is there a possibility in xmonad to prevent an application (in my case the web browser) from resizing to fullscreen when it's the only window on a workspace? I have a huge display and do not want chromium to resize to the full resolution. I've done a lot of searching on this problem (and I can't believe that I'm the only one with this issue) but didn't find anything about that. Maybe because of my bad English...
    As mentioned in the title, the WM is xmonad.
    Thank you very much.

    Well, you could write a manageHook that tests if it is the only window on the screen, and if it is, changes the layout, or floats the browser with a spesific size

  • Is it possible to start a web browser from with xterm (X11)?

    Hello,
    Would it be possible to start a web browser from xterm? I am able to use for example, dbca or netca. But I want to know if I could start a web brower in my xterm. Thank you.

    Thank you. Firefox was not found on this redhat linux, I am guessing it was not installed. I did a find / -name firefox but not finding it. I don't think the SA installed GUI on this box. Is there a browser I can use even though GUI was not installed? That is why I am attempting to use xterm hoping to be able to access a brower in xterm. I am using Xming for xterm. Is there something in Xming I can use so I can access the Oracle Database Control Console? I can use firefox from my desktop but the port is block at the firewall and the SA would not open the port due to security reasons. Thank you.

  • Can open a Web browser from the worksapce?

    Hi,
    we are using Adobe livecycle ES2.5, We are trying to add an action to our users to open a specific URL in a Web browser, is it doable?
    Thanks
    Hussam

    Thanks Nith,
    we did this before when using pdfs but in our case we are using Flex and we do not want to call the web browser from the flex we need it from the workspace directly,
    please see the attachment, when the user clicks complete we want to open the browser instead of submitting the form to the next step.
    any idea?
    Regards

  • How to open a web browser from java

    Hi
    Would anybody please help me with this. I need to open a web browser from my java app but I don't know. What method I can use?
    Thanks.
    Hung.

    You can use the Runtime class for this. It can run any command. So, you can run the .exe file of your Web browser.
    The following code will run Internet Explorer (assuming iexplorer.exe is in C:\Program Files\Internet Explorer):
    import java.lang.Runtime;
    public class Explore{
    public static void main(String[] args) {
    try{
    Process p = Runtime.getRuntime().exec("C:\\Program Files\\Internet Explorer\\iexplore");
    }catch (Exception e) {
    System.out.println("Exception: " + e);

  • Any new ideas for launching web browser from application

    I have searched the forums trying to find a new way of launching a web browser from a java application. The problem I am having is that on Unix and Linux systems, at least the variety I have access to (not quite sure on what that variety those are as they are not my systems or systems I control), the common method of using Runtime.getRuntime().exec(STRING) with either netscape or mozilla does not work. While using the Runtime.exec method is not the same as a console, I did try on these systems "netscape + A_WEB_ADDRESS" (or mozilla) and it did launch the respective browser with the page, so it appears that at least from the console level, those commands are valid.
    All the forums seem to say that the Runtime.exec method is the way to go. All the source code I have found through links from the forum say the same thing. I have voted on this bug:
    http://developer.java.sun.com/developer/bugParade/bugs/4210168.html
    and the feedback there does seem to indicate that there is similar trouble out there. Below is the code I am using. It does work on Win2000,XP, and Mac OSX. The application is not supported on earlier systems, and as it stands it will not work on Win 95,98, nor ME. Only small modification should be needed for work on those OSs, but as I no longer personally use those OSs, I cannot be sure.
    private void openNativeBrowser(String url) {
    // not the browser itself is started, i only call something like
    // start http://www.javasoft.com
    // and then the standardbrowser will be started ...
    StringBuffer call = new StringBuffer();
    System.err.println(System.getProperty("os.name"));
    System.err.println(System.getProperty("user.dir"));
    try {
    // which OS ?
    String operatingSystem = System.getProperty("os.name");
    // how to call the OS
    if (operatingSystem.toLowerCase().indexOf("windows") > -1)
    call.append("cmd /c start ").append(url);
    else
    if (operatingSystem.toLowerCase().indexOf("mac") > -1)
    call.append("open ").append(url + " &");
    else if(operatingSystem.toLowerCase().indexOf("linux") > -1)
    // use Script 'netscape'
    call.append("mozilla ").append(url).append(" &");
    else
    call.append("netscape ").append(url).append(" &");
    System.err.println(call.toString());
    // start it ...
    Runtime.getRuntime().exec(call.toString());
    catch (Exception e) {
    System.out.println(e.getMessage());
    e.printStackTrace();
    As I said, if you have a new way to call the broswer that seems to work on either Unix or Linux, please post it, point to it, or explain it.
    Aaron

    there is a shell script on Linux called htmlview that you can launch like this:
    String[] cmd = {"htmlview", "http://java.sun.com"};
    try {
        Runtime.getRuntime().exec(cmd);
    } catch (IOException ioe) {
        // do something
    }which will open the default browser. Don't think this is available on other *NIX though, although the script itself would probably work so you could include it with your app (/usr/bin/htmlview).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Self closing web browser when we reload a java3D applet!

    Hi,
    Recently, I opened a web site based on a new concept of sport gaming and I chose java3D for the portability and the capability to run as an applet in a web browser.
    But until now I don't know why the browser exit when we try to change the game, for example from football to basket-ball.
    After all we can always restart the browser but I don't know if it is a garbage collector problem or a browser problem, I try it with Mozilla-Firefox (Redhat and Suse) and Internet Explorer (Windows Me and 2000).
    the example code in the principal applet class is:
    public void destroy() {
    espaceBasket.destroy();
    System.gc();
    and in espaceBasket where is the universe etc. :
    public void destroy() {
    u.cleanup();
    If you want to execute the applets go to :
    www.mysportbridge.com
    Any comment...
    Thank you

    Thanks for the speedy reply.
    I understand that JCO connections should be closed properly, and I've read the attached note previously.
    What I'm actually looking for is a timeout connection for the Http/s session that can be seen in the Visual Administrator under:
    Monitoring > Services > Security > Agrregated Data > ActiveSessionsCount.
    The number of active session remains very high although there are no users logged onto the system.
    Regards
    Amesh

  • Video Streaming on Web Browser from Web Camera

    How to run Web Camera on to the Web Browser through JAVA and JMF?

    How to run Web Camera on to the Web Browser
    through JAVA and JMF? As someone who has written dozens of applets, and
    helped debug hundreds of them, I can tell you that
    applets are not for beginners.
    Whenever I must have an applet that is any more
    than completely trivial, I will code it as a combined
    application/applet, if only for making testing faster
    and easier.
    Further, if you have a working application, it can be
    'launched from a link', just like an applet, but using
    web start.
    I suggest you put aside the applet idea for the
    moment, and concentrate on doing this in an
    application.
    When that is working, you can decide whether
    to launch it using web start, or embed it as an
    applet in a web page.
    Here is an example of launching JMF (the
    player) using web start.
    http://www.javasaver.com/testjs/jmf/#test5
    As far as coding for a web cam, a quick Google leads to..
    "Here is the source code to JMF Webcam app + saves jpeg"
    http://forum.java.sun.com/thread.jspa?threadID=247253
    2 notes:
    1) I found that URL for the web cam code using
    Google. I have never dealt with web cams myself.
    2) Normally I ignore threads with no dukes. I am
    usually pretty busy, and dukes indicate how
    important a thread is - to whoever is asking.
    So, if you want to complete this task faster, you might
    - search for answers first.
    - add dukes to any question, to indicate interest.
    HTH

  • Can i open a page in Browser from an applet

    i want to open a web site in a new browser window from an applet.
    Is it possible. if posible then send me some links or codes
    thank you

    Do you know how to use applet to link to another webpage? set the target = _blank
    public class App extends Applet {
    getAppletContext().showDocument(new URL("http://java.sun.com"),"_blank");
    }

  • How to open a web browser from an windows phone app

    Hi everyone,
    I am pretty new to Windows Phone 7, and now what I am trying to do is to create a simple app. When a user click to start this app, a browser will open and show the content of a webpage from a specific address.
    I tried to use a webbrowser object, but it seems like that doesn't sport cookies. So I need my app to open a real web browser (maybe IE mobile) to do the job.
    Thank you.

    copying from stackoverflow: "If you want to embed a browser window inside your application then use  the WebBrowser control.  Add an instance of the WebBrowser control to  your form then you can reference it in code using the name you
    give  it.  (Default name is "webBrowser1")"
    Microsoft MVP J# 2004-2010, Borland Spirit of Delphi 2001

Maybe you are looking for