java jlabel array
<p>what's wrong with this? the labels[] causes an error</p>

<pre><code>JLabel labels[] = new JLabel();
    for (int i =  0; i &lt; 4; i++) {
       labels[i] = new JLabel("Label" + i);
       panel.add(labels[i]);
 }
</code></pre>
