title: Method setFont() not applicable for arguments [JLabel] (eclipse)
body: <p>This is the code below and I am getting error because of setfont() function applied on JLabel. The syntax of <code>setFont()</code> seems to be correct.</p>
  
  <pre><code>    import javax.swing.JFrame;
      import javax.swing.JLabel;
      import javax.swing.JTextField;
  
      public class Font  {
      public static void main(String Args[])
      {
      JFrame frame=new JFrame();
      frame.setBounds(100, 100, 450, 300);
          JLabel string1=new JLabel("Some Text");
          string1.setBounds(100,100,450,300);
          JTextField txt=new JTextField("add");
          string1.setFont (new Font("Arial", Font.Bold, 12));
          frame.setVisible(true);
          frame.add(string1);
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  
  
     }
   }
  </code></pre>
  
  <p>And the error is :</p>
  
  <pre><code>Exception in thread "main" java.lang.Error: Unresolved compilation problems: 
      The method setFont(java.awt.Font) in the type JComponent is not applicable for the arguments (Font)
      Bold cannot be resolved or is not a field
  
      at Font.main(Font.java:13)
  </code></pre>