class MyApplet extends Applet { public void paint(Graphics g) { Graphics2D g2 = (Graphics2D)g; // add drawing operations . . . } }