import java.awt.*;
import java.applet.Applet;
/**
* <p>Title: 簡單的Applet</p>
* <p>Description: 繼續Applet類,實現Applet方法。在屏幕說輸出一句問候語。</p>
* <p>Copyright: Copyright (c) 2003</p>
* <p>Filename: Hello_applet.java</p>
* @version 1.0
*/
public class Hello_applet extends Applet{
String s;
/**
*<br>方法說明:初始化
*<br>輸入參數:
*<br>返回類型:
*/
public void init()
{
s = "Hello! welcome into Applet world!";
}
/**
*<br>方法說明:輸出文字
*<br>輸入參數:
*<br>返回類型:
*/
public void paint(Graphics g)
{
setFont(new Font(s,Font.BOLD,16));
g.drawString(s,(getSize().width/2)/2,getSize().height/2);
}
}