13 Replies Latest reply on Dec 7, 2006 6:33 PM by 807599

    Problem

    807599
      I am using this source code:
      import java.applet.*;
      import java.awt.*;
      
      public class DrawingLines extends Applet {
      
         int width, height;
      
         public void init() {
            width = getSize().width;
            height = getSize().height;
            setBackground( Color.black );
         }
      
         public void paint( Graphics g ) {
            g.setColor( Color.green );
            for ( int i = 0; i < 10; ++i ) {
               g.drawLine( width, height, i * width / 10, 0 );
            }
         }
      }
      and it does not work in Firefox (or other browsers) using
      <applet width=300 height=300 code="DrawingLines.class"> </applet>
      I have an error output:

      Java Plug-in 1.5.0_06
      Using JRE version 1.5.0_06 Java HotSpot(TM) Client VM
      User home directory = C:\Documents and Settings\AdminChris
      ----------------------------------------------------
      c: clear console window
      f: finalize objects on finalization queue
      g: garbage collect
      h: display this help message
      l: dump classloader list
      m: print memory usage
      o: trigger logging
      p: reload proxy configuration
      q: hide console
      r: reload policy configuration
      s: dump system and deployment properties
      t: dump thread list
      v: dump thread stack
      x: clear classloader cache
      0-5: set trace level to <n>
      ----------------------------------------------------
      java.lang.UnsupportedClassVersionError: Bad version number in .class file
           at java.lang.ClassLoader.defineClass1(Native Method)
           at java.lang.ClassLoader.defineClass(Unknown Source)
           at java.security.SecureClassLoader.defineClass(Unknown Source)
           at sun.applet.AppletClassLoader.findClass(Unknown Source)
           at java.lang.ClassLoader.loadClass(Unknown Source)
           at sun.applet.AppletClassLoader.loadClass(Unknown Source)
           at java.lang.ClassLoader.loadClass(Unknown Source)
           at sun.applet.AppletClassLoader.loadCode(Unknown Source)
           at sun.applet.AppletPanel.createApplet(Unknown Source)
           at sun.plugin.AppletViewer.createApplet(Unknown Source)
           at sun.applet.AppletPanel.runLoader(Unknown Source)
           at sun.applet.AppletPanel.run(Unknown Source)
           at java.lang.Thread.run(Unknown Source)
      Exception in thread "Thread-24" java.lang.NullPointerException
           at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
           at sun.plugin.AppletViewer.showAppletException(Unknown Source)
           at sun.applet.AppletPanel.runLoader(Unknown Source)
           at sun.applet.AppletPanel.run(Unknown Source)
           at java.lang.Thread.run(Unknown Source)
      java.lang.NullPointerException
           at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
           at sun.plugin.AppletViewer.showAppletStatus(Unknown Source)
           at sun.applet.AppletPanel.run(Unknown Source)
           at java.lang.Thread.run(Unknown Source)
      Exception in thread "thread applet-DrawingLines.class" java.lang.NullPointerException
           at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
           at sun.plugin.AppletViewer.showAppletException(Unknown Source)
           at sun.applet.AppletPanel.run(Unknown Source)
           at java.lang.Thread.run(Unknown Source)

      It seems strange that it says Java Plug-in 1.5.0_06 when i have JRE 1.6.0 and JDK 1.6.0

      Do I need to make Firefox use the 1.6.0 version?