setColor()
import java.applet.Applet; import java.awt.*; public class Blockhead extends Applet { public void paint(Graphics g) { g.setColor(Color.blue); g.drawRect(30, 30, 50, 50); g.drawRect(35, 35, 10, 10); g.drawRect(65, 35, 10, 10); g.drawRect(50, 50, 10, 10); g.drawRect(40, 65, 30, 10); } }