Can I call browser window at applet?

I make the applet show simple information.
When user click the title of applet,
I want to invoke the browser window like window.open of javascript.
Is it possible?

You wouldn't necessarily need to use javascript. You could use the two-arg showDocument , in which the first arg is the URL and the second arg is the "target" link attribute. You can select values that cause new windows to open.
The method is in AppletContext, by the way. Just checked.

Similar Messages

  • How to close Browser window from Applet ?

    I am looking to close the browser window based on an action within applet . any ideas ?

    Hi U can close the Browser window in which the applet
    opened
    try this,
    Just call this where u want to close the browser
    import java.net.*;
    URL url;
    url=getCodeBase();
    try{                    getAppletContext().showDocument (new URL (url+"close.htm"));
    }catch(MalformedURLException e){showStatus("no file");}
    In the close.htm have this code
    ///close.htm
    <HTML><SCRIPT>
    <!--
    window.close();
    //-->
    </SCRIPT></HTML>

  • Can we call a window of one smartform in another smartform

    can we call a window of one smartform in another smartform?

    hi
    No it is not possible
    regards
    vijay
    reward points if helpful

  • Can we call the window in runtime in SAP Scripts  ?

    Hi
    Can we call the window (without placing the window in the layout at design time) in runtime in SAP Scripts 
    Thank You

    Hello,
    Calling a window at runtime is not posible.
    Let me know what u want to do exactly.
    Regards

  • How i can open a browser windows using a button in jsf ?

    Hi
    Thank you for reading my post
    how i can open a browser windows using a button in jsf ?
    for example if i want to open a window which will show http://www.mywebsite.com?name=TestName&family=TestFamily
    and before opening the window i need to set those two variables.
    can some one help me with a solution ?
    thank you

    Hi Legolas,
    Please refer to the answer provided by Chris in the EA forums.
    Cheers
    Giri

  • Close browser window from applet

    I have a simple applet that is called
    from another application through HTML.
    When the applet is done, I'd like to have
    it exit and close its browser window.
    How is this done? I tried System.exit(),
    and that didn't do it. Neither did
    destroy().

    The only thing I can think of is to have a function defined in JavaScript on your html page and have the applet call the method. For you to be able to do this you will have to have a MAYSCRIPT set in your applet tag.
    IE:
    <script language="JavaScript">
    function closeWindow()
    window.close();
    </script>
    <APPLET code="XYZApp.class" codebase="html/" align="baseline" width="200" height="200"
    MAYSCRIPT>
    </APPLET>
    In your applet:
    Make sure that you import the following.
    import netscape.javascript.*;
    JSObject win = JSObject.getWindow( this );
    win.call( "closeWindow", null );// Calls the closeWindow() on the HTML page.

  • Getting hang/crash problem when I try to close browser window from applet

    I have a small Apllet that has a button that calls a Javascript function in the opening window, to close the window in which it is loaded.
    The Applet window is a PopUp window from one of my application's window. First time I start my application and load that Applet the button works fine. It calls the Javascript method and the Method closes the window using the self.close() method.
    But now if I open the applet window again and click on the button to close the windows, it hangs. I put in trace statements and saw that it hangs on JSObject.getWindow() window.
    I am using JDK Plugin 1.4.2_07 and 5.0 , if I work out on IE browser, it works fine.But when I use firefox or mozilla it gives problem of hanging/crashing.
    Note that in case of 1.4.2_07 this problem experienced some times but in case of 5.0 it gives always for other than IE browser.
    Please, if somebody could give me some clue about why this would happen, I will really appreciate that. and code related to this is given below
    import javax.swing.JApplet;
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import netscape.javascript.JSObject;
    public class TestApplet extends JApplet implements ActionListener{
    protected JButton closeButton = null;
    protected JSObject win = null;
    private JFrame frame = null;
    private boolean alreadyClosed = false;
    public void init(){
    this.win = JSObject.getWindow(this);
    this.closeButton = new JButton("Close Browser Window");
    this.add(this.closeButton);
    this.closeButton.addActionListener(this);
    frame = new JFrame("Test Frame");
    frame.setSize(300, 400);
    frame.addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {
    System.out.println("windowClosing");
    alreadyClosed = true;
    TestApplet.this.stop();
    frame.show();
    public void actionPerformed(ActionEvent ae){
    stop();
    public void stop() {
    if (!alreadyClosed) {
    alreadyClosed = true;
    frame.dispose();
    closeLaunchedBrowser();
    System.gc();
    System.runFinalization();
    private void closeLaunchedBrowser() {
    final TestApplet thisObject = this;
    Runnable r = new Runnable() {
    public void run() {
    try {
    JSObject win = (JSObject)JSObject.getWindow(thisObject);
    if (win != null && win.toString() != null) {
    //win.eval("top.opener=self;self.close();");
    //win.call("close", null);
    win.eval("self.close();");
    } catch (Exception e) {
    Thread t = new Thread(r);
    t.start();
    Thanks.

    I am waiting for any reply. I have tried for all these below options still I am getting Problem. I heard this is because of javascript, it wont call methods more times .Thats
    why I need other than JSObject or java script solution.If some one know anything about this or any modifications I have to made for the below options to avoid that problem please let me know.
    // URL durl = new URL(thisObject.getCodeBase(), "test/CloseMe.htm");
    // System.out.println("URL :" + durl.toString());      
    // thisObject.getAppletContext().showDocument(durl);
    //     thisObject.getAppletContext().showDocument(new URL("javascript:window.close();"), "_self");
    //win.eval("top.opener=self;top.close();");
    //win.call("close", null);
    //Object[] args = { "close", new Integer(50) };
    // win.call("setTimeout", args);
    //win.eval("setTimeout("close", new Integer(50));");
    If it is the problem of JRE I just need it should work on 1.4.2_01 or higher.
    thanks.

  • Opening browser windows from applet

    I have 2 questions
    1) Does anyone know, what do I have to do to force my java applet to open new browser window with specified url ?
    2) Is any java class, which renders HTML files ? I'm trying to open some document in frame inside applet and I don't know if i have to write this renderer by myself.

    for your second question, I dont know if there is a specific HTML class but SAXParser makes reading xml very easy and you probably should have much trouble writing a class to read html.

  • Closing a browser window from applet

    i have applet opened in a IE browser.
    The applet contains TOOL BAR and one of the buttons in it is EXIT.so when i click this exit button the browser window should close.
    if any one has idea about it please let me know along with sample code.
    thanx in advance.

    try this
    on click of that exit button in action event write this
    System.exit(0);

  • Can't open browser window from RoboHelp AIR app??!

    We've got a RoboHelp course that we're exporting as an AIR app using the  Packager and it works great. We've got an embedded flash file that  needs to open a website in a browser window, but, currently it will only  load the site in a new AIR window...any ideas??

    I'm having this same problem also, although you gave me one option in your reply.  I can't get the "Allow" button to work either. I upgraded to Adobe Reader 9.2, and then is when I noticed I couldn't bring up the websites that I usually could before.  I don't really know what you mean about "Stand Alone Option," but I will try to find out.  I also upgraded to Internet Explorer 8, but I'm not sure if this is when the problem started or when I went to Adobe Reader 9.2.
    I used to be able to get "Allow" to work if I opened the document in IE8 and not in AR 9.2, but now that won't even work. I did email the author of a PDF document I was in today in the hopes he would have the answer, but I'm not sure if I got his email address right, so time will tell on that issue.
    I have a "library" of PDF documents, so I would really like to get this problem fixed.  However, I've spent at least two hours on this issue, and I really don't think it has anything to do with Windows Vista incompatibility; I'm pretty sure it has something to do with Adobe Reader, but that doesn't help much given I have emailed support and, of course, have never received an answer.
    I do know there are a lot of people that are having this exact same problem, but no one has an answer to it.  I've tried to do research on this, but I have a lot of "to do" tasks I need to get done every day, so it's not like I have all the time in the world to try and fix this problem.
    I would appreciate hearing from you if you do ever figure this out. My email address is [email address deleted by host] should you find an answer to this very frustrating problem. Warmly, Corinne Larimore [signature deleted by host]

  • Close browser window when applet closes (seperateFrame=True)

    Hello,
    Does anyone know a way to close the parent browser window when the java applet closes when the config setting seperateFrame=True?
    Thanks

    Do a little search in the forum, there are 100s of solutions on how to close the browser window.

  • Open a new browser window from applet

    Anybody know how to open a new Netscape window by pressing a button in an applet? Which class handles it?
    Thanks a lot.
    wz

    http://forum.java.sun.com/thread.jsp?forum=54&thread=106906
    http://forum.java.sun.com/thread.jsp?forum=54&thread=272870
    http://forum.java.sun.com/thread.jsp?forum=54&thread=272829

  • Can applet close the Web browser window it embedded in?

    I know that a link or button in the Web browser can close the browser window. But I really don't if the applet can also do it.

    This site does have a search function you know, and if thats too much trouble there is google:
    http://www.google.com/search?q=site%3Asun.com+%22java+to+javascript%22&ie=UTF-8&hl=nl&lr=
    This should point you in the direction of a thing called JSObject
    Here is some code since I have this in my archive anyway:
    the html file:
         <object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
                  height="0" width="0" >
            <param name="code" value="someApplet.class" />
            <!--[if !IE]> Mozilla/Netscape and its brethren -->
            <object classid="java:someApplet.class"
                    height="0" width="0"
                    >
            </object>
            <!-- <![endif]-->
          </object>
    <LABEL id="lblOutputText">This text is the HTML text </LABEL>the applet:
    // new class for jsObject!!!! compile this: javac -classpath "C:\Program Files\Java\j2re1.4.2_01\lib\plugin.jar" someApplet.java
    // since jaws.jar does not exsist anymore
    // in 1.4.0 to compile: javac -classpath "C:\j2sdk1.4.0_03\jre\lib\jaws.jar" someApplet.java
    import netscape.javascript.*;
    public class someApplet extends java.applet.Applet {
        JSObject win;
        public void init() {
             try{
                 win = JSObject.getWindow(this);
    // you need win.eval("window.close();"); // to close the window. if the current window is not a popup
    // opened by a parent with window.open than the user will get a waring, your next question probably will
    // be "can I stop this warning" and the answer is simple: NO
                 JSObject textBoxLabel = (JSObject) win.eval("document.getElementById('lblOutputText')");
                 textBoxLabel.setMember("innerHTML", "<center><h1>Some text</h1></center>");
            }catch(Exception e){
                 e.printStackTrace();
    }

  • Can I close the browser window

    Hi! friends,
    I am in the process of upgrading to forms 6.0
    when we load the form in the webbrowser, is there a
    way I can close the browser window once I exit the form.
    Please advise
    Thanks in advance

    You can try this solution from Metalink:
    Customers want to close the browser's window when they close the forms application.
    Solution Description:
    USE JAVASCRIPT TO CLOSE THE WEBFORM APPLET
    Solution Explanation:
    1.)Create an html file (es. close.html):
    <html>
    <body onload="closeit()">
    <script>
    function closeit()
    window.close();
    </script>
    </body>
    </html>
    2.) Put the html file in the webserver root.
    3.)Inside the Form in a POST-FORM trigger you have to write a WEB.SHOW_DOCUENT builtin like this one: web.show_document('http://mywebserver.com/close.html','_self');
    In this way the web.show_document calls, the JavaScript function "closeit()", when the the applet is closing.

  • How can  we popup "Operating System Browse Window " in OAF?

    Hi...
    I have "Import" button on page.
    I want to display "Operating System Browse Window:" when user hits import
    button.
    This Browse window will navigate user to choose a file.

    Hi,
    You can use the component messageFileUpload for that. You can find some instructions on using it in the OAF Developer's Guide, Chapter 4: Implementing Specific UI Features, on the section "File Upload / Download". When you put a messageFileUpload on the page, it automatically renders the button to call Browse Window.
    Thanks!
    Thiago

Maybe you are looking for