import java.awt. *; public class Hwa1 extends java.applet.Applet { private Font newfont; public int xsize, ysize, xcoord = 60; // determine size of applet public void init () { xsize = this.size ().width; ysize = this.size ().height; newfont = new Font ("TimesRoman", Font.ITALIC, 30); } // paint method handles drawing public void paint (Graphics g) { g.setFont (newfont); g.setColor (Color.red); g.drawString ("Hello World!", xcoord, ysize / 2); } }