用JAVA 编写Applet程序,选择3种不同字体写出字符串“I LOVE BEIJING!”
1个回答
展开全部
import java.applet.Applet;
import java.awt.Font;
import java.awt.Graphics;
public class BeColor extends Applet{
public void paint(Graphics g){
g.setFont(new Font("黑体",Font.BOLD,20));
g.drawString("I LOVE BEIJING", 0, 20);
g.setFont(new Font("SansSerif", Font.ITALIC, 20));
g.drawString("I LOVE BEIJING", 0, 50);
g.setFont(new Font("Monotype Corsiva", Font.CENTER_BASELINE, 20));
g.drawString("I LOVE BEIJING", 0, 80);
}
}
import java.awt.Font;
import java.awt.Graphics;
public class BeColor extends Applet{
public void paint(Graphics g){
g.setFont(new Font("黑体",Font.BOLD,20));
g.drawString("I LOVE BEIJING", 0, 20);
g.setFont(new Font("SansSerif", Font.ITALIC, 20));
g.drawString("I LOVE BEIJING", 0, 50);
g.setFont(new Font("Monotype Corsiva", Font.CENTER_BASELINE, 20));
g.drawString("I LOVE BEIJING", 0, 80);
}
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询