A Flicker-Free Drawing SurfaceWhenever I try to change the font from inside a drawing surface's paint method, the contents of the drawing surface flicker. What's going on? The problem originates from calling the wrong setFont method. Instead of calling setFont via the Graphics argument, you are calling the inherited setFont method from the Component class. When you call this method, a recursive loop is established and the drawing surface flickers. Here is a code fragment that demonstrates incorrectly and correctly setting the font: public void paint (Graphics g) |