Netscape.javascript.JSException: Native Window is destroyed

Supposedly this code closes the window in which the applet is displayed.
try{
     JSObject win = (JSObject) JSObject.getWindow(this);
     win.eval("self.close();");
catch(JSException ex){
     System.out.println(ex.getWrappedException().toString());
catch(Exception ex){
     System.out.println(ex.toString());
}But I am getting "netscape.javascript.JSException: Native Window is destroyed" every time I run it. I Googled this exception, and to my surprise, I got 0 results. Does anyone know what is causing this or how to avoid it?
I tried adding the method "close_window()" to the page, and calling that function with win.eval(), but I get the same error.
The browser in question is Firefox on Windows XP. It is running an applet in a "bare bones" windows, with no toolbars or status bars.

I've never used that exact call, what about a slightly different method:
try{
     JSObject win = (JSObject) JSObject.getWindow(this);
     win.call("close", new Object[0]);
catch(JSException ex){
     System.out.println(ex.getWrappedException().toString());
catch(Exception ex){
     System.out.println(ex.toString());
}

Similar Messages

  • Netscape.javascript.JSException: Unable to obtain Document object

    Hi all.
    I'm fighting against a very unusual problem involving applets and, probably, version 1.4.2_XX of the jre (in fact i've been looking for an answer over the Internet and I've found only one item related in the java programming forum. Unfortunately it was not resolved on any of the answers http://forum.java.sun.com/thread.jsp?thread=452400&forum=31&message=2532663).
    The thing is that the applet is unable to obtain any information about the parameters passed through the page; consequently, it finally crashes showing this ugly message:
    netscape.javascript.JSException: Unable to obtain Document object
         at sun.plugin.AppletViewer.getDocumentBase(Unknown Source)
         at sun.plugin.AppletViewer.getCodeBase(Unknown Source)
         at sun.plugin.AppletViewer.appletInit(Unknown Source)
         at sun.plugin.viewer.LifeCycleManager.initAppletPanel(Unknown Source)
         at sun.plugin.viewer.IExplorerPluginObject$Initer.run(Unknown Source)as I said I've been looking for information over the Internet but it seems that few people knows about it. Any suggestion? Does anybody knows if it is a mater of the IExplorer?
    The configuration of the client machine is:
    Windows XP SP1
    IExplorer 6.0
    Although the same has ocurred over:
    Windows 2000
    IExplorer 6.0
    Thank you for your time.

    Can you reproduce this error with html and applet code (and post this code)?
    A full trace might tell you something:
    To turn the full trace on you can start the java console, to be found here:
    C:\Program Files\Java\j2re1.4...\bin\jpicpl32.exe
    In the advanced tab you can fill in something for runtime parameters fill in this:
    -Djavaplugin.trace=true -Djavaplugin.trace.option=basic|net|security|ext|liveconnect
    The trace is here:
    C:\Documents and Settings\your user\Application Data\Sun\Java\Deployment\log\plugin...log

  • Netscape.javascript.JSException is never thrown in body of corresponding tr

    I have the following try/catch block:
    try
              netscape.javascript.JSObject.getWindow(this.applet).eval("ClkExcept(" + nId.toString() + ")");
            }catch(netscape.javascript.JSException e){}Which, for as long as I have compiled (until recently) compiled fine. However, when I recently had to recompile the classes containing this code because of an unrelated issue, I now get a message from the compiler stating that exception netscape.javascript.JSException is never thrown in body of corresponding try statement. I am attempting to use the latest 1.3.1_XX SDK (I must compile with some build of 1.3.1), but have run into this compiler message with all builds of 1.3.1 that I have tried. All documentation I can locate for the netscape.javascript.JSObject class states that the GetWindow() function can throw an exception of type netscape.javascript.JSException.
    Has anyone seen this before, or does anyone have any suggestions on how to get the compiler working correctly?

    This code has not been edited in two years, but has
    been recompiled numerous times since then (until
    today) without any compiler messages pertaining to
    this try/catch block. I know for a fact that the
    GetWindow() function can throw a JSException. Have you changed compilers recently?
    Have you tried compiling a brand new tiny test program in a different directory, with an explicit -classpath arg that contains only that relevant jar file, and no other classes in the directory?
    Have you tried extracting the class file from the jar, running it through a decompiler, and seeing what it says about the exception?
    If I
    remove the try/catch block and there is a problem
    with the javascript function that is called on the
    page hosting my applet there would obviously be an
    exception to catch. Removing the try/catch block is
    not a solution.You could try catching Exception instead. That will pass the compiler, because Exception includes RuntimeException and its descendants, and the compiler can't know that those won't be thrown, since they're unhecked. I'd consider that a last-ditch hack though, and wouldn't do it unless I'd thoroughly investigated first.

  • MyApplet.java:2: Class netscape.javascript.JSObject not found in import.

    Hi,
    Im getting: MyApplet.java:2: Class netscape.javascript.JSObject not found in import.
    import netscape.javascript.JSObject;
    Where can i get this package. Someone said jaws.jar, but its not to be found. Im new on this project and I dont know how the old people compiled this applet.
    JDK version is:
    Solaris VM (build Solaris_JDK_1.2.2_10, native threads, sunwjit)
    Thanks

    Thanks man!
    I installed the jdk1.4 on my workstation. I then compiled the program via JDeveloper and pumped the class over to my server.
    Thanks again.

  • Netscape.javascript.JSObject for mac

    I have the latest NetBeans version for mac os 10.5.
    What do I need to do to get access to the netscape.javascript package.
    I am trying to read cookies written using php into an applet. I am also open to solutions that do not need netscape.javascript.
    I am a beginner to the mac os so I am unable to translate the many solutions that appear to be for windows users. Apparently all I need to do is add Plugins.jar to my classpath, but I cannot find Plugins.jar, (or java40.jar or JAWS.JAR which apparently contained these packages in various releases), none of which I can find on my mac or available for download.
    I am sure this is very simple but I am running out of hair to pull out.

    I believe that for Mac, the required jar can be called plugin.jar or netscape.jar.
    Its location is somewhere around */System/Library/Frameworks/JavaVM.framework/Versions/<your version>/Home/lib*
    I don't have a Mac so I can't verify this , sorry.
    Good luck.

  • Unable to load php file into native window..

    Hi Guys,
    Im using flash cs3 as my development environment. what i was trying to do is creating a small login application using Air. I must say im still a newbie to flash air. as far as my login system concern i have managed following tasks,
    1. send username ans password using post and validate through php
    2. get the result back to flash application and open up a new native air window if the login is success.
    3. close the login window.
    now what i want to do is load my PHP application inside that newly open native window. How can i do it. I tried using Loader() method but it only worked for images not for php or html files.
    heres how I tried to use the loader method,
    var url:String = "http://localhost/Flash/login/welcome.php";
    var fileLoader:Loader = new Loader();
    fileLoader.load(new URLRequest(url));
    win.stage.addChild(fileLoader);
    This failed.
    Does anyone know how to load a PHP file into a Native window? Your help highly appreciate it.
    Just in case for the people who wants to know who I did the above mentioned tasks heres the code,
    Posting data to PHP server
    function sendLoginData() {
         if(txtUserName.text=='')
              txtBox.text = 'Username is empty';
         else if(txtPassword.text=='')
              txtBox.text = 'Password is empty';
         else
              var variables:URLVariables = new URLVariables();
              variables.UserName = txtUserName.text;
              variables.Password = txtPassword.text;
              var request:URLRequest = new URLRequest("http://localhost/Flash/login/login.php"); 
              var loader:URLLoader = new URLLoader(); 
              loader.dataFormat = URLLoaderDataFormat.TEXT; 
              request.data = variables; 
              request.method = URLRequestMethod.POST; 
              loader.addEventListener(Event.COMPLETE, handleComplete); 
              loader.addEventListener(IOErrorEvent.IO_ERROR, onIOError); 
              loader.load(request);
    Handdle the returned data
    function handleComplete(event:Event):void
         var variables:URLVariables = new URLVariables(event.target.data); 
         if(variables.errorcode==0)
              var url:String = "http://localhost/Flash/login/welcome.php";
              try {                             
                   //Native window
                   var options:NativeWindowInitOptions = new NativeWindowInitOptions();
                   options.systemChrome = NativeWindowSystemChrome.STANDARD;
                   options.transparent = false;
                   options.maximizable=false;
                   var win:NativeWindow = new NativeWindow(options);
                   win.title = 'welcome page';
                   //win.width = 900;
                   //win.height = 900;
                   /*var fileLoader:Loader = new Loader();
                   fileLoader.load(new URLRequest(url));
                   win.stage.addChild(fileLoader);*/
                   win.maximize();
                   win.activate();
                   stage.nativeWindow.close();
              } catch (e:Error) {
                trace("Error occurred!");
         else
              txtBox.text = 'Invalid logins';
    function onIOError(event:IOErrorEvent):void
         trace("Error loading URL."); 
    PHP code
    <?php
    $username = addslashes($_POST['UserName']);
    $password = addslashes($_POST['Password']);
    //do your database checking here. this is an example
    if($username=='niroshan' && $password=='123456')
         echo "errorcode=0"; 
    else
         echo "errorcode=1"; 
    ?>
    Call the function when pressing the submit
    cmdButton.addEventListener(MouseEvent.CLICK,readySendLoginData);
    function readySendLoginData(evt:MouseEvent){    
      sendLoginData();
    Thanks,
    best regards,
    Niroshan

    Thats right, HTMLLoader should solve the issue as Loader used for JPEG, PNG OR GIF files loading as per my knowledge

  • FLV Playback and Seekbar on different native windows in one Air application

    Hello Everyone.  I'm trying to make a simple video playback AIR application that utilizes the initial native window to house a transport control with a seekbar on it.  Once the application launches, it creates a second (new) window on my second screen and places a FLVPlayback instance on that new window.  Everything works just like it want it to except for one thing.  When the seekbar and FLVplayback instance are not located on the same window stage, the seekbar handle sticks to the mouse when trying to scrub through the video.
    I've added both the transport control and the FLVPlayback instance to the original native window as children and I have also added both of them to the new window as children and everything works just fine.  It's only when they are separated and located on different stages that the seekbar acts up.  When they are on the same stage, I can click on a point on the seekbar and the video jumps to that spot and continues to play and I can also scrub the seekbar, the video updates as I scrub, and when I release the mouse, the seekbar handle stays where I released the mouse.  When they on separate stages, the seekbar handle continues to follow the mouse movement without releasing it.  The video updates as the seekbar handle is moved due to it sticking to the mouse, but if I release the mouse, the handle is still moving with the mouse and the video is still being scrubbed.  Like I said, everything works great except for this and I have reached my limit with time spent on this issue.  Does anyone have any insight into this?
    Here's my code for the project.  This is my first AIR application, so I am coding it as I am learning, please be kind.
    import fl.video.*;
    import flash.display.*;
    import flash.desktop.*;
    import flash.events.*;
    import fl.video.MetadataEvent;
    import flash.geom.*;
    import flash.ui.Mouse;
    import flash.text.*;
    GLOBAL SETUP
    var flvControl:FLVPlayback;
    var MasterWindow = stage.nativeWindow;
    var screen1:Screen = Screen.screens[0];
    var screen2:Screen = Screen.screens[1];
    MASTER WINDOW SETUP
    this.loaderInfo.addEventListener(Event.COMPLETE,maximize);
    transControl.playPauseButt2.addEventListener(MouseEvent.CLICK, PlayButton);
    if (Screen.screens.length > 1){
              createVideoBKG();
              createVideoPlayer();
    GENERAL FUNCTIONS
    //Maximize the initial screen
    function maximize(e:Event) {
              MasterWindow.x = screen1.bounds.left
              MasterWindow.maximize();
              MasterWindow.stage.scaleMode = StageScaleMode.EXACT_FIT;
    //Hide Mouse Behind Video Window On Roll-Over
    function MouseRollOver(e:MouseEvent):void
              {          Mouse.hide()          }
    function MouseRollOut(e:MouseEvent):void
              {          Mouse.show()          }
    //Play-Pause Button Control
    function PlayButton(event:MouseEvent):void
                        if(transControl.playPauseButt2.currentFrame==1 ){
                                  transControl.playPauseButt2.gotoAndPlay(2);
                                  flvControl.play();
                        else {
                                  transControl.playPauseButt2.gotoAndPlay(1);
                                  flvControl.pause();
    function CloseWindow(e:MouseEvent):void
                        NativeApplication.nativeApplication.openedWindows[2].close();
    VIDEO BKG SETUP
    function createVideoBKG(e:Event = null):void{
              var newOptions:NativeWindowInitOptions = new NativeWindowInitOptions();
              newOptions.type = NativeWindowType.LIGHTWEIGHT;
              newOptions.systemChrome = NativeWindowSystemChrome.NONE;
              newOptions.transparent = true;
              var videoBKG:NativeWindow = new NativeWindow(newOptions);
              if (Screen.screens.length > 1){
                        videoBKG.x = screen2.bounds.left;
              videoBKG.maximize();
              chromeSetup(videoBKG);
              videoBKG.activate();
    //Video BKG Chrome Setup
    function chromeSetup(currentWindow):void {
              var vidBKG = new video_bkg();
              vidBKG.name = "video_bkg2";
              vidBKG.addEventListener(MouseEvent.ROLL_OVER, MouseRollOver);
              vidBKG.addEventListener(MouseEvent.ROLL_OUT, MouseRollOut);
              currentWindow.stage.addChild(vidBKG);
    VIDEO Player SETUP
    function createVideoPlayer(e:Event = null):void{
              var newOptions:NativeWindowInitOptions = new NativeWindowInitOptions();
              newOptions.type = NativeWindowType.LIGHTWEIGHT;
              newOptions.systemChrome = NativeWindowSystemChrome.NONE;
              newOptions.transparent = true;
              var videoPlayer:NativeWindow = new NativeWindow(newOptions);
              if (Screen.screens.length > 1){
                        videoPlayer.x = screen2.bounds.left;
                        videoPlayer.y = screen2.bounds.top;
                        videoPlayer.width = screen2.bounds.width;
                        videoPlayer.height = screen2.bounds.height;
                        videoPlayer.stage.scaleMode = StageScaleMode.NO_SCALE;
              videoPlayer.alwaysInFront = true;
              var DVR = new DVR_Player();
              DVR.name = "DVR";
              DVR.x = 0;
              DVR.y = 0;
              DVR.addEventListener(MouseEvent.ROLL_OVER, MouseRollOver);
              DVR.addEventListener(MouseEvent.ROLL_OUT, MouseRollOut);
              videoPlayer.stage.addChild(DVR);
                flvControl = DVR.display2;
              flvControl.width = 1280;
              flvControl.height = 720;
              flvControl.skin = null;
              flvControl.autoPlay=false;   
              flvControl.isLive=false;
              flvControl.fullScreenTakeOver = false;
              flvControl.align = VideoAlign.CENTER;
              flvControl.scaleMode = VideoScaleMode.NO_SCALE;
              flvControl.source = "olympics.f4v";
              flvControl.seekBar = transControl.seekbarContainer2.seeker;
              videoPlayer.activate();

    Does anyone have any ideas about this?

  • Where to download netscape.javascript.JSObject?

    I have this statement in my Java program
    import netscape.javascript.JSObject , and when i cannot compile. May I know where I can download this package?

    Hi,
    Check out below links, i hope it will help you.
    http://docs.iplanet.com/docs/manuals/js/server/jsref/lcjsobj.htm
    http://www.netscape.com/eng/mozilla/3.0/handbook/javascript/packages.htm#1007459
    http://www.mozilla.org/oji/MRJPlugin.html
    http://developer.netscape.com/docs/technote/javascript/liveconnect/liveconnect_rh.html
    http://www.innovation.ch/java/HTTPClient/disp_html.html
    Thanks,
    Dakshin.

  • Incorrect functionality of Embedded tag in html page, displaying object on top of all layers of Adobe air application native window

    Title
    Incorrect functionality of embed tag in html loader for adobe air development
    Description
    Problem Description: If we had loaded youtube.com video url in a view stack and navigate to other index of stack or away from we UI screen within the same native window video or embeded tag of flash player or any other embed object will be displayed on top of all screens layer in same position of where the object should be placed in side of html loader only.
    Steps to Reproduce:
    1) go to http://get.straweb.com/StraWebBrowser/StraWebBrowser.air download and install
    2) load 2 tabs and in the 3 tab load video player of youtube.com which will a sample video
    before completing the load of 3 tab which trying to load video from youtube.com, navigate to other tabs 1 or 2 in few second once the flash player of youtube.com video player is load it will display in the current tab or UI screen.
    3) Try navigating to other tabs than youtube.com loaded tab you see the flash player is on top it stable.
    4) navigate to 3 tab and try to navigate to other tab you can observe that so how it will not show that flash player and only visible in that 3 tab which is fine.
    Actual Result: Embedded tag of html page displaying on top of all layers of Adobe air application native window
    Expected Result: Embedded tag of html page should only displayed in side htmlloader
    This you can replicate in any adobe air plugin update and on any Hardware and Environment.
    Applicable to all sdk versions of adobe air.

    Adobe Bugbase: Bug 3823839 Incorrect functionality of embed tag in html loader for adobe air development

  • How To open a PDF in New Native Window in Air

    Hi All,
    I have a Air application.I want to open an pdf located in desktop in new native window.
    Thanks,
    Amol.

    There is no easy way to implement this. Its better to instruct users the shortcut to open the link in new window.
    --Cheers

  • How do i make a pure actionscript as simple native window?

    Hello @all anythings,
    I ask about a sample pure framework by Flex for Adobe Air.
    An Example: Window with customizable buttons - If i use boolen  for visible or invisible buttons like this:
    http://livedocs.adobe.com/flex/3/html/help.html?content=Part6_ProgAS_1.html
    For Example:
    NativeWindowPanel:
    <sm:NativeAirWindow icon="true" closable="true" minimizable="true" resizable="false">
    </sm:NativeAirWindow>
    How do i know that code with AS3. I want to build custom window for native window - Non-FlexChrome?
    Sorry my Language is same problematy...
    But I want to learn about pure actionscript for creating sample frameworks & components.... That is new native Language for German?
    Thanks and best regards...
    Snake Media Inc

    <code>
    [http://example.com text]
    </code>

  • Embedding Applet in native Windows Application

    Hi!
    I need to integrate applet into my windows application (MSVC).
    The problem is displaying applet(s) within the application's main window (just like in browser).
    Is there a way to do it? Using WebBrowser (IE) ActiveX component is unacceptable.
    Perhaps there is documentation how to use JRE browser plugin, but googling yielded no results :(

    <offtopic>Apparently my login no longer working, re-registered</offtopic>
    ActiveX bridge won't do, I have to load an applet from any .jar
    The idea is to write kind of applet loader, which may be able to load jar and display applet.
    To start with, I need to know the way of paiting Java application GUI (i.e. JFrame) inside the native window.
    There is one way I've found. First, create borderless JFrame with some unique title, then use FindWindow in C++ Application to obtain HWND (window handle), and then call SetParent. I know there is more elegant way using JAWT to obtain HWND, the main problem is that Java window is rendered separately and only then becomes a part of native window, because HWND could be get on visible window only. This results unneccessary mess and flicking on screen for user.
    So, how can I render Java GUI directly to native window?
    I used search and haven't found solution.
    Thank you!
    PS found http://forum.java.sun.com/thread.jspa?forumID=52&threadID=5124062
    but this guy haven't said how he ded that :(
    Edited by: deniska25 on Oct 15, 2007 1:52 PM

  • Can't Import netscape.javascript; classpath set properly

    I have an applet that is trying to say
    import netscape.javascript.*No matter how I try to compile it, I get the error
    package netscape.javascript does not existI am primarily using ant for building; here is the pertinent section of my build.xml file:
    <property name="output" location="javaclasses" />
       <target name="compile">
          <javac srcdir="./"
                 destdir="${output}"
                 includes="**/*.java"
                 classpath="./,\
                            javaclasses/packages/epsgraphics.jar,\
                            /usr/lib/jvm/java-1.5.0-sun-1.5.0_update13-sr2/jre/lib/plugin.jar,\
                            javaclasses"
                 listfiles="yes">
          </javac>
       </target>Note that plugin.jar is included in my classpath. Using jar -tf <...>/plugin.jar, I can see that it contains the netscape package, the javascript subdirectory, and the JSObject.class I am interested in.
    Attempting to resolve this manually with the command line
    javac -classpath "./;javaclasses/packages/epsgraphics.jar;/usr/lib/jvm/java-1.5.0-sun-1.5.0_update13-sr2/jre/lib/plugin.jar;javaclasses" myApplet.javagives the same error.
    Moving plugin.jar to my local directory, or any other directory specified in the classpath (which worked just fine until I tried accessing plugin.jar) and re-jiggering the classpath so it can be located gives the same result: it can't find netscape.javascript.
    I'm using javac from java-1.5.0-sun-1.5.0_update13-sr2 on Suse Linux 10.3.
    What am I missing here?

    As noted, the class is present in the jar file, as revealed with 'jar -tf plugin.jar'
    I've fiddled with separators, as well. You're correct that a colon is used under Linux; that is what I had used in earlier attempts, but wound up copying the latest incarnation, which was desperately cribbed from another forum's example, thinking that Java might have other ideas. None of the variants I tried worked.
    Trying it again, replacing the command line given with colons, still doesn't work; fails with the same message.
    Currently pursuing another Ant solution, with no joy.
    Thanks for your reply.

  • LiveConnect - where do i import netscape.javascript.* from?

    I'm trying to get some LiveConnect stuff running with a Java applet, but can't seem to find where to import
    the package netscape.javascript.* from.
    Can anyone please help? Many thanks

    I've just installed Linux 9, jdk1.4.2_04, and Netscape 7.1.
    I am trying to compile a working program (on Win.XP) using Ant.
    I'm getting an error on the "import netscape.javascript.*;" statement.
    I've reviewed many forum posts but I can't find the plugin.jar file anywhere.
    I do have a plugin.pack file in <JAVA_HOME>/jre/lib
    Anybody got an idea where plugin,jar might be or is plugin.pack some incantation I missed?
    If so, what do I do with it?
    Jim

  • Netscape.javascript.ISObject ????

    I'm new in Java so I don't know how to add any external classes to my Java environment. I've downloaded
    the ifc112 library, I have all sources, I defined the environment variable CLASSPATH but still when I write in code:
    import netscape.javascript.JSObject;
    the compiler tells my that the netscape package no found. Maybe I need somthing more then j2sdk1.4.2_03?
    please help!

    The JSObject is located in plugin.jar which located in: ..\java\j2rel..4.2_03\lib on my machine.
    plugin.jar is part of the Java 1.4 sdk.
    Direct your project to reference plugin.jar and it should fix your problem.
    [email protected]

Maybe you are looking for

  • Connecting to a database in Dreamweaver/ColdFusion

    Please Help! I've created database connections to both Mysql and MS Access databases in the ColdFusion Administrator Data Source page (I've used both Mysql and Access to test what's wrong with the connection). However, I can't connect to them in Drea

  • M30: FX G05200 + external Widescreen Monitor: Resolution 1440x900 not available

    Hi! I`ve got the following problem: I`d like to connect a external TFT Widescreen Monitor with a native resolution of 1440x900 to my Satellite M30 with a GeForce FX Go5200. But: It is not possible to adjust the resolution of the Graphics Card to 1440

  • Show/hide objects/fields in PDF application (form) ...

    Hello, I'm creating a PDF application (form). The layout is being done in InDesign then the fields/buttons/drop-down boxes are being added in Acrobat Pro. I have a situation in the application where the user will select an option from a drop-down men

  • No privileges on tablespace

    i exported a table from database test to other database through logical backup. while importing i am getting error ora-01950-no privileges on table space 'mchtbs' the user from which i exported the table default table space is mchtbs. i am getting my

  • Updated to Quick Time 7 Pro but Can't view trailers

    I updated to Quick Time 7 Pro and every thing looks ok when Quick Time is opened. But when I try to view movie trailers on this website it continues to tell me that I need to download Quick Time. Help.