title: Unable to add an object to a jComboBox; addItem(...) method only accepts String
body: <p>I have problem in my Java application. Namely, I am getting an error when trying to add an object to a jComboBox.</p>
  
  <pre><code>incompatible types: Radnik cannot be converted to String
  </code></pre>
  
  <p>Where <code>Radnik</code> is the name of the class I'm trying to add.</p>
  
  <p>This happened to me before, and it seems to be a problem with IDE or JDK, 'cause it seems to happen only in the app I'm working on, but when I do the same thing in another app, it works fine.
  I'm working in Netbeans' latest version and JDK 1.8</p>
  
  <p>I don't think I need any additional libraries for that, and my <code>Radnik</code> class has it's <code>toString()</code> method overriden.</p>
  
  <p>The code where I try to add it to a combo box:</p>
  
  <pre><code>private void popuniComboR(List&lt;Radnik&gt; lr){
      jcmbRadnik.removeAllItems();
      for (Radnik r : lr) {
          jcmbVrstaPos.addItem(r);
      }
  }
  </code></pre>
  
  <p>This gives me an error.</p>