AWT splash screen problem

From: Henry (e.moreira_at_verizon.net)
Date: 03/27/04


Date: Sat, 27 Mar 2004 18:41:36 GMT

I am trying to implement a splash screen with my program and been having
  runtime errors. I get a NoClassFound Exception eventhough both
classes are in the same directory and are in the same package.

The original code is found at this site:

http://www.randelshofer.ch/oop/javasplash/javasplash.html

Here is the code I'm having problems with

package napos2;

import java.awt.Frame;
import java.awt.Toolkit;
import java.net.URL;
import java.io.*;

public class NaposSplash {

     public static void main(String [] args) {
         Frame splashFrame=null;
         URL imageURL=NaposSplash.class.getResource("splash.gif");
         if (imageURL!=null) {
             splashFrame=NaposSplashWindow.splash(
                  Toolkit.getDefaultToolkit().createImage(imageURL));
         }
         else {
             System.err.println("Splash Image Not Found");
         }
         try {

             Class.forName("Napos") /*I get a ClassNotFound
Exception here*/

                 .getMethod("main", new Class[]{String.class})
                 .invoke(null,new Object[] {args});
         }catch(Throwable e){
             e.printStackTrace();
             System.err.flush();
             System.exit(10);
         }
         if (splashFrame!=null)
             splashFrame.dispose();
     }

}

and I get the following Error Message:

java.lang.ClassNotFoundException: Napos
         at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:141)
         at napos2.NaposSplash.main(NaposSplash.java:49)

Any suggestions?

Henry Moreira