2013-12-23 83 views
0

剛剛完成我的第一個編程課程並做得很好,並決定從本書開始製作一些圖形內容。當applet查看運行的代碼是否符合得很好,那麼它說開始:小程序未初始化使用Java Applet視圖時Applet未初始化

import javax.swing.JApplet; 
import java.awt.*; 
/* <applet code = "test" width = 700 height = 700> </applet> */ 
public class HappyFace extends JApplet 
{ 
    public void paint(Graphics canvas) 
    { 
    canvas.drawOval(100, 50, 200, 200); 
    canvas.fillOval(155, 100, 10, 20); 
    canvas.fillOval(230, 100, 10, 20); 
    canvas.drawArc(150, 160, 100, 50, 180, 180); 
    } 
} 

回答

1

類被稱爲HappyFacetest

<applet code="HappyFace" width = 700 height = 700> </applet>