是不是初始化的问题?初始化必须放在init()中,而且不能有main方法.

解决方案 »

  1.   

    初始化全在init()中做的.是不是浏览器不支持??
      

  2.   

    我用IE6.0,Firefox 1.0都不行.
      

  3.   

    问题很简单,请先看:(摘自JBuilder Tutorial)
    It's important to remember when designing applets that browser support for Java can be limited (depending on the browser you use). If you design your applet using Java AWT components, which are generally supported by most browsers, such as Netscape Navigator and Microsoft Internet Explorer. However, if you want to design an applet using Swing components, you need to determine what Java capabilities your browser supports. Generally, you can find browser support information for Java applets by looking in the Tools, Preferences, or Help menu contents of Netscape or Internet Explorer. The safest way to design your applet is by using AWT components and the JDK that the browser supports.
    If you create your applet using javax.swing.JApplet, your applet won't run in most web browsers. At the time of this writing, Swing is not yet supported by the web browsers.愚的理解:
    开发javaApplet最好用AWT不要用swing,用swing需要浏览器支持,迄今为止,浏览器都不支持swing组件。所以楼主会遇到这个问题。
    建议:多看看java的Tutorial,虽然是英文,但是它包含了很多有用的知识,读完受益菲浅!
      

  4.   

    所有的浏览器都不支持swing组件吗?
    不过,awt技术已经逐步淘汰了.
    还有好办法吗?