title: Casting Inner Class to a superclass
body: <p>I'm actually casting subclasses to superclasses through a code line.
  Because of special needs, i've made an Inner Class, but i'm not able to cast, at least with the same code, this class into superclass</p>
  
  <p>Example</p>
  
  <pre><code>((Indicator)listaIndicatori.elementAt(i)).draw(this,schermo);
  </code></pre>
  
  <p>Works.</p>
  
  <pre><code>((Indicator)listaIndicatori.elementAt(i)).draw(this,schermo);
  </code></pre>
  
  <p>Does not work with an Inner Class of Indicator.</p>
  
  <p>The Inner class is declared inside indicator class as follows</p>
  
  <pre><code>public class Bars extends JPanel
  </code></pre>
  
  <p>How can i solve?</p>