how to close applet from appletviewer using a command


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: how to close applet from appletviewer using a command

Hybrid View

  1. #1
    Samuel Tang Guest

    how to close applet from appletviewer using a command


    i tried to close an applet from appletviewer using:
    System.exit(0);

    it works on win2000,
    but in unix machine it produced exception like this

    java.security.AccessControlException: access denied (java.lang.RuntimePermission
    exitVM)
    at java.security.AccessControlContext.checkPermission(AccessControlContext.java:272)
    at java.security.AccessController.checkPermission(AccessController.java:399)

    how can i solve this problem?
    thank you.

  2. #2
    Paul Clapham Guest

    Re: how to close applet from appletviewer using a command

    Don't use System.exit(0) to close the applet.

    PC2

    "Samuel Tang" <tong_ien@hotmail.com> wrote in message
    news:3bd6b4ec@news.devx.com...
    >
    > i tried to close an applet from appletviewer using:
    > System.exit(0);
    >
    > it works on win2000,
    > but in unix machine it produced exception like this
    >
    > java.security.AccessControlException: access denied

    (java.lang.RuntimePermission
    > exitVM)
    > at

    java.security.AccessControlContext.checkPermission(AccessControlContext.java
    :272)
    > at

    java.security.AccessController.checkPermission(AccessController.java:399)
    >
    > how can i solve this problem?
    > thank you.




  3. #3
    atlrus Guest

    Re: how to close applet from appletviewer using a command


    "Samuel Tang" <tong_ien@hotmail.com> wrote:
    >
    >i tried to close an applet from appletviewer using:
    >System.exit(0);
    >
    >it works on win2000,
    >but in unix machine it produced exception like this
    >
    >java.security.AccessControlException: access denied (java.lang.RuntimePermission
    >exitVM)
    > at java.security.AccessControlContext.checkPermission(AccessControlContext.java:272)
    > at java.security.AccessController.checkPermission(AccessController.java:399)
    >
    >how can i solve this problem?
    >thank you.


    hey,tang
    why don`t you try to catch that exception?and then to close it with a 'finally'?
    try that and tell me what happens.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center