title: How to change colors at paint(Graph)
body: <p>I have a code for paint in a JPanel, but i dont know how to change colors outside the method paint()</p>
  
  <p>I give the code: </p>
  
  <pre><code>public void paint(Graphics g) {
          Graphics2D g2 = (Graphics2D) g;
          g2.setColor(Color.RED);
          for (Shape linea : lineas) { // dibuja todos las elipses
              g2.draw(linea);
          }
      }
  </code></pre>
  
  <p>I only know to change the color at that method using <code>g2.setColor(Color.RED);</code>  but I want to change it in an actionListener of a MenuItem. </p>