下面是用户程序对Applet类中方法paint()的重新定义,请在横线处填入正确的语句。 public void paint(Graphics g) {g.【 】(“你好!”,10,20);}

admin2010-02-22  24

问题 下面是用户程序对Applet类中方法paint()的重新定义,请在横线处填入正确的语句。
   public void paint(Graphics g)
   {g.【  】(“你好!”,10,20);}

选项

答案drawstring

解析 AWT的绘图机制主要涉及三个方法:paint()方法、update()方法和repaint()方法。其中,update()方法和paint()方法都有一个Graphics类参数。Graphics类有许多绘图的方法,在本题中应该用绘制文本的drawstring (string,x,y)方法。即在Applet窗口(x,y)坐标处写字符串string。
转载请注明原文地址:https://kaotiyun.com/show/Fb9p777K
0

最新回复(0)