好的,这是我的第一个小程序,我多次尝试绕过这个异常。任何形式的帮助将不胜感激!谢谢!
这是我的代码:
package Application;
import java.applet.*;
import java.awt.*;
import javax.swing.JApplet;
import javax.swing.JButton;
import javax.swing.JPanel;
public class FirstApplet extends JApplet
{
private JPanel jpnlMain = new JPanel(new BorderLayout());
private JPanel jpnlBoutton = new JPanel(new GridLayout(5,5));
private JPanel jpnlLogo = new JSplash(this);
private GenericRoundedButton[] jbtnAllo = new GenericRoundedButton[10];
public void init(){
super.init();
this.add(jpnlMain);
for(int i =0;i<jbtnAllo.length;i++){
jbtnAllo[i] = new GenericRoundedButton();
jpnlBoutton.add(jbtnAllo[i]);
}
jpnlMain.add(jpnlBoutton,"North");
jpnlMain.add(jpnlLogo,"Center");
}
}
这是我的 HTML 代码:
<html>
<title>The ImageDemo applet</title>
<hr>
<applet code="Application.FirstApplet.class" width="400" height="400">
</applet>
<hr>
</html>