g.setColor(Color.red); // set the drawing pen colour g.fillrect(100, 100, 100, 100); // draw a filled square g.drawString("One red square", 100, 220); // write the string