How to assign value inside a Runnable Thread : <p>I have the next code:</p>

<pre><code>    for(int i = 0; i &lt; fileRefernces.size(); i++) { 
        Thread t = new Thread(new Runnable() {
                    public void run() {
                        JLabel pageNumber = new JLabel("&lt;html&gt;&lt;font color='#003b86'&gt;PAGE" + (i + 1) + "&lt;/font&gt;&lt;/html&gt;", JLabel.LEFT);
                        JLabel imageLabel = new JLabel(image, JLabel.LEFT);
                        // content would be probably some Image class or byte[]

                        // or:
                        // InputStream in = Loc.openStream();
                        // read image from in
                    }
                });
    }
</code></pre>

<p>But, just at the moment to assign the value, I get the next error:</p>

<blockquote>
  <p>error: local variables referenced from an inner class must be final or
  effectively final</p>
</blockquote>

<p>How I can assign values to those variables?</p>
