Problem with Applet Security


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Problem with Applet Security

  1. #1
    Join Date
    Dec 2002
    Posts
    2

    Unhappy Problem with Applet Security

    Hey folks, i have just completed my first java aplet game based on the old arkanoid 'not again',lol, anyways the game runs fine on my laptop which has ME and the 1.4 sdk/jdk blah blah blah installed yet when i run it on my desktop it wont start and if it does runs VERY slow, my desktop is a 1.4gig and my laptop is a p2 366, im doing this as part of second year at uni and am quite new to java, anyways here is the error from the debugger.

    Set uncaught java.lang.Throwable
    Set deferred uncaught java.lang.Throwable
    >
    VM Started: java.security.AccessControlException: access denied (java.lang.RuntimePermission modifyThreadGroup)
    at java.security.AccessControlContext.checkPermission(AccessControlContext.java:270)
    at java.security.AccessController.checkPermission(AccessController.java:401)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:542)
    at sun.applet.AppletSecurity.checkAccess(AppletSecurity.java:169)
    at java.lang.ThreadGroup.checkAccess(ThreadGroup.java:287)
    at java.lang.Thread.init(Thread.java:286)
    at java.lang.Thread.<init>(Thread.java:332)
    at JBreak.init(JBreak.java:48)
    at sun.applet.AppletPanel.run(AppletPanel.java:347)
    at java.lang.Thread.run(Thread.java:536)

    and im getting a null pointer exception when the paint method is trying to paint the graphics, anyone spot whats wrong without me posting the whole code,lol,any help would be great thanks

  2. #2
    Join Date
    Aug 2002
    Posts
    94
    Just my thoughts (though I could be wrong):

    You must have created an image for buffering - when you call the getGraphicsContext() method to get the Graphics object for background painting then it is returned as "null" and hence the error you are getting.

    Check if the image you are creating for buffering is created in same context as the getGraphics() method call?

    Just a wild shot - hope it works for you!
    bye

  3. #3
    Join Date
    Feb 2003
    Posts
    15
    just a shot (due to past experiences), how are you displaying the image.......

    is it through a ImageIcon.paintIcon() method, or a Graphics.drawImage() method....
    i have encountered the same exception while trying to use the ImageIcon.paintIcon() method in an applet, but am yet to find out what's wrong.

    sorry, more of a question than an answer.
    Linux?!?!?!
    What is that, something to eat?

    "All things being equal, the simplest solution tends to be the best."
    Acham's Razor

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