Adding a ActionPerformed Array to a String Array
<p>Before you guys ask, yes I've searched online for the answer, but everything I found just leaves a lil confuse and nothing is recent so asking in those forums won't really help.</p>

<p>My problems is this:</p>

<p>I have an array that holds my name for a menu.</p>

<pre><code>String[] fontColor = new String[] {"Red", "Blue", "Green"};

for (int i = 0; i &lt; fontColors.length; i++) {
     JMenuItem fontC = new JMenuItem(fontColors[i]);
     fontC.addActionListener(new fontColorAction());
     changeFontColor.add(fontC);
}
</code></pre>

<p>Then I have an array that holds my color change in a class called fontColorAction</p>

<p>in that class I have another array that does the same thing as my string array except all thats in the statement is textarea.setForeground(colorArr[i]);</p>

<p>that will set the setForeground() in order, but now how do I successfully attact the action listner in my class to my menuItems?</p>

<p>my class looks like this</p>

<pre><code>private class fontColorAction implements ActionListener {
     Color[] colorArr - new Color[] {"Color.RED","Color.BLUE","Color.GREEN"};
     public void actionPerformed(ActionEvent e){
          for(i = 0; i &lt; collorArr.length; i++){
               textarea.setForeground(colorArr[i]);
          }
     }
}
</code></pre>
