Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8332275
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T02:40:30+00:00 2026-06-09T02:40:30+00:00

I want to make an applet so that it can be used to display

  • 0

I want to make an applet so that it can be used to display a game which extends JPanel. This class will be a part of the library. So I do not know the name of the class. I had to load it dynamically. Here’s my current implementation.

package com.gej.core;

import javax.swing.JApplet;
import javax.swing.JOptionPane;

/**
 * Runs a game as an Applet by loading the class dynamically at runtime. The
 * name of the class should be specified as a parameter named game-class.
 * 
 * @author Sri Harsha Chilakapati
 */
public class GApplet extends JApplet {

    private static final long serialVersionUID = 1994280929713148311L;

    String gmname = "";

    public GApplet(String gmname) {
        this.gmname = gmname;
    }

    public GApplet() {
        gmname = "";
    }

    public void init(){
        if (gmname == null || gmname == "") {
            gmname = JOptionPane.showInputDialog("Enter game class name");
        }
        try {
            Class<?> gameClass = getClass().getClassLoader().loadClass(gmname);
            add((Game) gameClass.newInstance());
        } catch (ClassNotFoundException e) {
            System.err.println("Error finding class : " + gmname);
        } catch (InstantiationException e) {
            System.err.println("Error loading class : " + gmname);
        } catch (IllegalAccessException e) {
            System.err.println("Error loading class : " + gmname);
        }
    }
}

The problem I’m having is that this works well in the Applet Viewer but doesn’t work in any other browser (tested on Firefox, Opera, Epiphany, Internet Explorer, Chrome). The error is it says Applet not initialized.

Output of console

java version "1.6.0_23"
OpenJDK Runtime Environment (IcedTea6 1.11pre) (6b23~pre11-0ubuntu1.11.10.2)
OpenJDK Client VM (build 20.0-b11, mixed mode, sharing)
/build/buildd/icedtea-web-1.1.3/build/../plugin/icedteanp/IcedTeaNPPlugin.cc:631: thread
0xb75368e0: Error: Unknown plugin value requested.
/build/buildd/icedtea-web-1.1.3/build/../plugin/icedteanp/IcedTeaNPPlugin.cc:631: thread 
0xb75368e0: Error: Unknown plugin value requested.
java.util.zip.ZipException: error in opening zip file
    at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:131)
at java.util.jar.JarFile.<init>(JarFile.java:150)
at java.util.jar.JarFile.<init>(JarFile.java:101)
at net.sourceforge.jnlp.tools.JarSigner.verifyJar(JarSigner.java:241)
at net.sourceforge.jnlp.tools.JarSigner.verifyJars(JarSigner.java:201)
at net.sourceforge.jnlp.runtime.JNLPClassLoader$4.run(JNLPClassLoader.java:1145)
at net.sourceforge.jnlp.runtime.JNLPClassLoader$4.run(JNLPClassLoader.java:1143)
at java.security.AccessController.doPrivileged(Native Method)
at net.sourceforge.jnlp.runtime.JNLPClassLoader.addNewJar(JNLPClassLoader.java:1143)
at net.sourceforge.jnlp.runtime.JNLPClassLoader.loadClass(JNLPClassLoader.java:1043)
at net.sourceforge.jnlp.Launcher.createApplet(Launcher.java:712)
at net.sourceforge.jnlp.Launcher.getApplet(Launcher.java:672)
at net.sourceforge.jnlp.Launcher$TgThread.run(Launcher.java:884)
java.security.PrivilegedActionException: java.util.zip.ZipException: error in opening zip file
at java.security.AccessController.doPrivileged(Native Method)
at net.sourceforge.jnlp.runtime.JNLPClassLoader.addNewJar(JNLPClassLoader.java:1143)
at net.sourceforge.jnlp.runtime.JNLPClassLoader.loadClass(JNLPClassLoader.java:1043)
at net.sourceforge.jnlp.Launcher.createApplet(Launcher.java:712)
at net.sourceforge.jnlp.Launcher.getApplet(Launcher.java:672)
at net.sourceforge.jnlp.Launcher$TgThread.run(Launcher.java:884)
Caused by: java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:131)
at java.util.jar.JarFile.<init>(JarFile.java:150)
at java.util.jar.JarFile.<init>(JarFile.java:101)
at net.sourceforge.jnlp.tools.JarSigner.verifyJar(JarSigner.java:241)
at net.sourceforge.jnlp.tools.JarSigner.verifyJars(JarSigner.java:201)
at net.sourceforge.jnlp.runtime.JNLPClassLoader$4.run(JNLPClassLoader.java:1145)
at net.sourceforge.jnlp.runtime.JNLPClassLoader$4.run(JNLPClassLoader.java:1143)
... 6 more
net.sourceforge.jnlp.LaunchException: Fatal: Initialization Error: Could not initialize applet.
at net.sourceforge.jnlp.Launcher.createApplet(Launcher.java:728)
at net.sourceforge.jnlp.Launcher.getApplet(Launcher.java:672)
at net.sourceforge.jnlp.Launcher$TgThread.run(Launcher.java:884)
Caused by: java.lang.ClassNotFoundException: com.gej.GApplet
at net.sourceforge.jnlp.runtime.JNLPClassLoader.loadClass(JNLPClassLoader.java:1089)
at net.sourceforge.jnlp.Launcher.createApplet(Launcher.java:712)
... 2 more
Caused by: 
java.lang.ClassNotFoundException: com.gej.GApplet
at net.sourceforge.jnlp.runtime.JNLPClassLoader.loadClass(JNLPClassLoader.java:1089)
at net.sourceforge.jnlp.Launcher.createApplet(Launcher.java:712)
at net.sourceforge.jnlp.Launcher.getApplet(Launcher.java:672)
at net.sourceforge.jnlp.Launcher$TgThread.run(Launcher.java:884)
java.lang.NullPointerException
at net.sourceforge.jnlp.NetxPanel.runLoader(NetxPanel.java:109)
at sun.applet.AppletPanel.run(AppletPanel.java:380)
at net.sourceforge.jnlp.NetxPanel.run(NetxPanel.java:69)
at java.lang.Thread.run(Thread.java:679)
java.lang.NullPointerException
at sun.applet.AppletPanel.run(AppletPanel.java:430)
at net.sourceforge.jnlp.NetxPanel.run(NetxPanel.java:69)
at java.lang.Thread.run(Thread.java:679)

Update

I’ve managed to get rid of that by updating the plugin. Here’s the new log.

java.security.AccessControlException: access denied (java.util.PropertyPermission sun.java2d.opengl write)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:393)
at java.security.AccessController.checkPermission(AccessController.java:553)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
at net.sourceforge.jnlp.runtime.JNLPSecurityManager.checkPermission(JNLPSecurityManager.java:284)
at java.lang.System.setProperty(System.java:744)
at com.gej.core.Game.init(Game.java:83)
at com.gej.core.Game.<init>(Game.java:69)
at com.breakout.Breakout.<init>(Breakout.java:55)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
at java.lang.Class.newInstance0(Class.java:372)
at java.lang.Class.newInstance(Class.java:325)
at com.gej.core.GApplet.init(GApplet.java:38)
at sun.applet.AppletPanel.run(AppletPanel.java:436)
at net.sourceforge.jnlp.NetxPanel.run(NetxPanel.java:69)
at java.lang.Thread.run(Thread.java:679)

Solved

This is what I had changed and it solved

try {
    System.setProperty("sun.java2d.opengl", "true");
} catch (Exception e) {
    // System doesn't support opengl
}

I’ve modified the code so that it’ll be only setting the property in windowed or fullscreen mode only

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T02:40:31+00:00Added an answer on June 9, 2026 at 2:40 am
    java.security.AccessControlException: access denied 
        (java.util.PropertyPermission sun.java2d.opengl write)
    

    Only a trusted applet can set the property. Digitally sign the code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to make a tray applet using Qt that will use an output
I have an applet that I'm running online and I want to make sure
I have a java applet, I want to make sure that nobody use it
I want to make an instance variable that can't be accessed from outside. Is
I want make a bash script which returns the position of an element from
I want make interactive application where user launches it and can do various task
I have style sheet with a class name changebackgroundcolor i want make change in
For my CS11 class, I have to write a small applet that draws a
Is there anyone who can answer this? It really doesn't make sense and I
I want to make a ca concurrent applet. What I'm trying to do is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.