• Resolved patjk

    (@patjk)


    I am having issues getting a Java applet working. I have tested this offline on my PC and it works. When I go into WordPress and paste exactly as below, it doesn’t work. This is what I’m pasting in the HTML editor:

    <applet
        code="RubikPlayer.class" archive="rubikplayer.jar" width="80" height="80">
      <PARAM name="scriptLanguage" value="SupersetENG">
          <PARAM name="scriptProgress" value="0">
          <PARAM name="displayLines" value="0">
    <param name="alpha" value="-20">
                                            <param name="beta"  value="35">
          <PARAM name="colorTable" value="0x003373,0xff4600,0xf8f8f8,0x00732f,0x8c000f, 0xffd200,0x707070">
    
          <PARAM name="stickers"
    value="4,4,4,4,4,4,4,4,4, 3,3,3,3,3,3,3,3,3, 2,2,2,2,2,2,2,2,2, 1,1,1,1,1,1,1,1,1, 0,0,0,0,0,0,0,0,0, 5,5,5,5,5,5,5,5,5">
      <param name="Script" value="TL">
    </applet>

    When I view source of the page, I noticed that for some reason the HTML editor puts
    after each line automatically, which causes issues with the first line <applet . To fix this, I attempted to move the second line up to the <applet line, but that causes issues with the Java (not sure why).

    So my question is, how can I prevent the HTML editor from automatically adding
    tags at the end of each line in my applet code?

    Thanks in advance!

Viewing 10 replies - 1 through 10 (of 10 total)
  • Not that anyone these days are using an archaic form the java applet, but you may want to simply close the first tag properly.

    Thread Starter patjk

    (@patjk)

    Can you suggest the proper way of doing this was it works? Am I not closing the first tag properly (notice the second line)?

    Yes I do see that now, but I think java applets need to be from a trusted source for a browser to run them.

    https://docs.oracle.com/javase/tutorial/deployment/applet/security.html

    Thread Starter patjk

    (@patjk)

    Thanks. I am wondering how to get rid of the auto “br” tags put into the code when using HTML source.

    Anyone have any further suggestions? Thanks.

    These are most likely from white space or hidden formatting – paste the code into NotePad, delete the ‘spaces’ and then cut and paste to the HTML editor

    Thread Starter patjk

    (@patjk)

    I did that with no luck. If I put the second line up to the first, I get an error.

    Any other ideas? Thanks

    We are trying to remove white space – don’t run code into eachother, remove what is between and add a space back if needed, for example no space is required between a > and a < or two spaces between “beta” and value

    <applet code="RubikPlayer.class" archive="rubikplayer.jar" width="80" height="80"><PARAM name="scriptLanguage" value="SupersetENG"><PARAM name="scriptProgress" value="0"><PARAM name="displayLines" value="0"><param name="alpha" value="-20"><param name="beta" value="35"><PARAM name="colorTable" value="0x003373,0xff4600,0xf8f8f8,0x00732f,0x8c000f,0xffd200,0x707070"><PARAM name="stickers" value="4,4,4,4,4,4,4,4,4, 3,3,3,3,3,3,3,3,3, 2,2,2,2,2,2,2,2,2, 1,1,1,1,1,1,1,1,1, 0,0,0,0,0,0,0,0,0, 5,5,5,5,5,5,5,5,5"><param name="Script" value="TL"></applet>

    Thread Starter patjk

    (@patjk)

    When I copy and paste exactly what you posted, I get the error:

    Java Plug-in 1.6.0_26
    Using JRE version 1.5.0_30-b03-389-9M3425 Java HotSpot(TM) Client VM
    User home directory = /Users/patkellyload: class RubikPlayer.class not found.
    java.lang.ClassNotFoundException: RubikPlayer.class
    	at sun.plugin2.applet.Applet2ClassLoader.findClass(Applet2ClassLoader.java:252)
    	at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Plugin2ClassLoader.java:250)
    	at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Plugin2ClassLoader.java:180)
    	at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Plugin2ClassLoader.java:161)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
    	at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Plugin2ClassLoader.java:687)
    	at sun.plugin2.applet.Plugin2Manager.createApplet(Plugin2Manager.java:3046)
    	at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Plugin2Manager.java:1498)
    	at java.lang.Thread.run(Thread.java:655)
    Exception: java.lang.ClassNotFoundException: RubikPlayer.class

    I think some of it has to be on a separate line, but not certain. I know for sure it isn’t an issue with the jar file or the class, since this works when I test it offline on my PC.

    Thread Starter patjk

    (@patjk)

    Anyone else? I can’t figure this out. Any other ideas would be much appreciated. It seems like a simple fix, but nothing I’ve tried works.

    Thanks in advance!

    Thread Starter patjk

    (@patjk)

    Solved. The .jar file needed to be uploaded via WordPress and used the full path to it instead of file.jar in the applet.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Problem getting Java Applet working’ is closed to new replies.