看看你的html文件是否与Panel.class在同一个目录下。

解决方案 »

  1.   

    to horseliu():
       是在同一个目录下。
      

  2.   

    我用appletviewer试过了,你的程序和html都没有问题。不过,因为你的Applet里用到了Swing,所以你需要用SUN新的Plugin来执行这个applet。********************************************************************
    你需要新的Panel.html:    <OBJECT
            CLASSID = "clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
            WIDTH = "200"
            HEIGHT = "100"
            ALIGN = "middle"
            CODEBASE= "http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0">
        <PARAM NAME = CODE VALUE = "Panel" >
        <PARAM NAME = "type" VALUE="application/x-java-applet;version=1.3">
        <PARAM NAME = "scriptable" VALUE="false">
        <PARAM NAME = "Producer" VALUE  = " rongxiaoxie(xie)">
        </OBJECT>-----------------------------------------------------------------
    Is it ok?
      

  3.   

    The APPLET Tag 
    When you build <APPLET> tags, keep in mind that words such as APPLET and CODEBASE can be typed in either as shown or in any mixture of uppercase and lowercase. Bold font indicates something you should type in exactly as shown (except that letters don't need to be uppercase). Italic font indicates that you must substitute a value for the word in italics. Square brackets ([ and ]) indicate that the contents of the brackets are optional. 
    < APPLET
        [CODEBASE = codebaseURL]
        CODE = appletFile 
        [ALT = alternateText]
        [NAME = appletInstanceName]
        WIDTH = pixels
        HEIGHT = pixels 
        [ALIGN = alignment] 
        [VSPACE = pixels]
        [HSPACE = pixels]
    >
    [< PARAM NAME = appletParameter1 VALUE = value >]
    [< PARAM NAME = appletParameter2 VALUE = value >]
    . . .
    [alternateHTML]
    </APPLET>CODEBASE = codebaseURL 
    This optional attribute specifies the base URL of the applet -- the directory or folder that contains the applet's code. If this attribute is not specified, then the document's URL is used. CODE = appletFile 
    This required attribute gives the name of the file that contains the applet's compiled Applet subclass. This file is relative to the base URL of the applet. It cannot be absolute. ALT = alternateText 
    This optional attribute specifies any text that should be displayed if the browser understands the APPLET tag but can't run Java applets. NAME = appletInstanceName 
    This optional attribute specifies a name for the applet instance, which makes it possible for applets on the same page to find (and communicate with) each other. WIDTH = pixels 
    HEIGHT = pixels 
    These required attributes give the initial width and height (in pixels) of the applet display area, not counting any windows or dialogs that the applet brings up. ALIGN = alignment 
    This optional attribute specifies the alignment of the applet. The possible values of this attribute are the same (and have the same effects) as those for the IMG tag: left, right, top, texttop, middle, absmiddle, baseline, bottom, absbottom. VSPACE = pixels 
    HSPACE = pixels 
    These optional attributes specify the number of pixels above and below the applet (VSPACE) and on each side of the applet (HSPACE). They're treated the same way as the IMG tag's VSPACE and HSPACE attributes. < PARAM NAME = appletParameter1 VALUE = value > 
    <PARAM> tags are the only way to specify applet-specific parameters. Applets read user-specified values for parameters with the getParameter() method. See Defining and Using Applet Parameters for information about the getParameter() method. alternateHTML 
    If the HTML page containing this <APPLET> tag is viewed by a browser that doesn't understand the <APPLET> tag, then the browser will ignore the <APPLET> and <PARAM> tags, instead interpreting any other HTML code between the <APPLET> and </APPLET> tags. Java-compatible browsers ignore this extra HTML code. 
    In the online version of this tutorial, we use alternate HTML to show a snapshot of the applet running, with text explaining what the applet does. Other possibilities for this area are a link to a page that is more useful for the Java-ignorant browser, or text that taunts the user for not having a Java-compatible browser. 
      

  4.   

    你先改照成application之后,在dos下运行一下,成功再加入applet.
      

  5.   

    public static void main(.....