Re: Ending a Java application from JavaScript

<[email protected]> Tue, 18 Jul 2006 20:05:58 +0100
Newsgroups gmane.comp.mozilla.jrex
Message-ID <[email protected]>
Hi Ander Ruiz,

Thank you. It works like a charm.

Best regards,

Guilherme.




----- Original Message ----- 
From: "Ander Ruiz" <[email protected]>
Newsgroups: gmane.comp.mozilla.jrex
Sent: Wednesday, July 12, 2006 8:27 PM
Subject: RE: Ending a Java application from JavaScript


>I think that the problem is that you are blocking the
> JRexEventDispatcher. Try with this code, I should work
>
>  In EndClass, I have the following method
>
>     public static void killApplication()
>     {
>         new Thread()
>         {
>              public void run()
>              {
>                   System.exit(0);
>              }
>         }.start();
>     }
>
>
> --- godutra-PkbjNfxxIARBDgjK7y7TUQ-XMD5yJDbdMReXY1tMh2IBg@public.gmane.org escribió:
>
>> Hi all,
>>
>>  Is it possible finish a application from
>> JavaScript?
>>
>>  I am trying something like:
>>
>>  <script>
>>              endClass =
>>
> java.lang.Class.forName("InfoEducacional.Virtus.Interface.EndClass");
>>              endObject = endClass.newInstance();
>>              endObject.killApplication();
>>  </script>
>>
>>  In EndClass, I have the following method
>>
>>     public static void killApplication() {
>>         System.exit(0);
>>     }
>>
>>
>>  Unfortunatelly, JFrame and system freeze.
>>
>>  Is there a better way to do this?
>>
>>  Something like this would be nice
>>
>> <script>
>>     window.close();
>> </script>
>>
>> Is it possible to handle or capture
>> 'window.close()'?
>>
>> Thanks in advance.
>>
>> Guilherme Dutra
>> _______________________________________________
>> JRex mailing list
>> JRex-hfdxhZW8pNUdnm+yROfE0A-XMD5yJDbdMReXY1tMh2IBg@public.gmane.org
>> http://mozdev.org/mailman/listinfo/jrex
>>
>
>
>
>
> ______________________________________________
> LLama Gratis a cualquier PC del Mundo.
> Llamadas a fijos y móviles desde 1 céntimo por minuto.
> http://es.voice.yahoo.com