title: How to change font in drawString of array in java?
body: <p>I am having problem of changing the font in drawstring that uses array string inside paint method. i am trying to change the font to bold and this is my code-</p>
  
  <pre><code>public void paint(Graphics g)
   {//PRINTING OF QUESTIONS
   k=0;
   for(i=0;i&lt;5;i++)
   {
   Font myFont = new Font("Segoe UI", Font.PLAIN,12);
  que[x[i]].setFont(myFont);
  
   g.drawString((i+1)+" ."+que[x[i]],50,50+k);
   k=k+150;
  }
   }
  </code></pre>
  
  <p>The above code is showing this error-</p>
  
  <pre><code>Cannot find Symbol.
  que[x[i]].setFont(myFont);
  </code></pre>
  
  <p>but while adding 'myFont' to add() of any array it is changing the font.</p>