可以正常编译,但是运行时提示
“Exception in thread "main" java.lang.NoClassDefFoundError: SplashDemo/class”[code]
import java.awt.*;
public class SplashDemo extends Frame
{
    public SplashDemo() {
        Image imgSplash = Toolkit.getDefaultToolkit().getImage("xjdw105.gif");
        ImagePane pnlImage = new ImagePane(imgSplash);
        Window splashWindow = new Window(this);
        splashWindow.add(pnlImage, BorderLayout.CENTER);
        Dimension scmSize = Toolkit.getDefaultToolkit().getScreenSize();
        int nImageWidth = imgSplash.getWidth(this);
        int nImageHeight = imgSplash.getHeight(this);
        splashWindow.setSize(nImageWidth, nImageHeight);
        splashWindow.setLocation(scmSize.width / 2 - nImageWidth / 2,
                                 scmSize.height / 2 -
                                 nImageHeight / 2);
        splashWindow.show();
        splashWindow.toFront();
        try 
        {
            Thread.currentThread().sleep(5000);
        }
        catch (Exception e) 
        {
            e.printStackTrace();
        }
        splashWindow.dispose();
    }    public static void main(String[] args) 
    {
        SplashDemo frmSplashDemo = new SplashDemo();
        System.exit(0);
    }
}
class ImagePane extends Panel
{
    private Image imgSplash;
    public ImagePane(Image image)
    {
        MediaTracker mt=new MediaTracker(this);
        mt.addImage(image,0);
        try
        {
            mt.waitForID(0);
        }
        catch(Exception e)
        {
            e.printStackTrace();
        }
        this.imgSplash=image;
    }
    public void paint(Graphics g)
    {
        g.drawImage(imgSplash,0,0,this);
    }
    public Dimension getPreferredSize()
    {
        return new Dimension(imgSplash.getWidth(this),imgSplash.getHeight(this));
    }
}
[/code]