62,623
社区成员
发帖
与我相关
我的任务
分享 private String quote ;
private Font f;
public void init()
{
quote = "Happiness is an attitude.";
String fontname = getParameter("font");
int fontsize = Integer.parseInt(getParameter("size"));
f = new Font(fontname,Font.ITALIC,fontsize);
}
public void paint(Graphics g)
{
g.setFont(f);
g.drawString(quote,20,100);
} <html>
<applet code="TestApplet.class" width=400 heigth=200>
<param name=font value="Helvetica"/>
<param name=size value="28"/>
</applet>
</html>