Why does the Applet not produce output in the font I set? <p>I made an applet wherein I assigned the font properties to a <strong>Font</strong> class object <strong>f</strong> in the <strong>Applet</strong> class. In the <strong>paint()</strong> method I used the <strong>setFont()</strong> method to set the font properties of the current Graphics object to that of <strong>'f'</strong>. But the <strong>drawString()</strong> method seems to display in the default font (maybe <strong>Arial</strong>) and not the font I set (though the <strong>font size</strong>, <strong>font style</strong> and <strong>colour</strong> was what I set). This is supposed to work according to the book I followed but isn't. Please find me the flaws in my code. Thanks. </p> <pre><code>/*Applet to use set Font*/ import java.applet.*; import java.awt.*; public class UsingFont extends Applet { Font f=new Font("Algerian",Font.BOLD,30); @Override public void init() {} @Override public void paint(Graphics g) { g.setFont(f); g.setColor(Color.orange); g.drawString("ALGERIAN FONT",20,15); }//paint }//class </code></pre>