问答题 利用JApplet扩展DisplayQuote子类,并用paint(Graphics g)编写宽400、长200的窗口,在该窗口中显示字符串"are you ready"的Applet程序和HTML文件。
【正确答案】import java.awt.*; import javax.swing.*; public class DisplayQuote extends JApplet{ public void paint(Grahpics g){ g.drawString("are you ready",20,20); } } //Quote.html <html> <title>Quotation</title> <applet code="DisplayQuote.class"width=400 height=200></applet> </html>
【答案解析】