title: Java JComponent doesn't refresh
body: <p>I've got problem with my class Component. The problem is that my ovals doesn't changing their colors. The function if is observing OVF flag in class Counter. when OVF=true ovals should be red, and when OVF=false ovals should be white. in my GUI i can see only red ovals (even if OVF=false). I try to add repaint() command but red ovals only started blinking. Here is my code:</p>
  
  <pre><code>import java.awt.*;
  import javax.swing.*;
  import java.util.Observable;
  
  
  public class Komponent extends JComponent
  {
  Counter counter3;
  public Komponent()
  {
      counter3=new Counter();
  }
  public void paint(Graphics g) 
  {
   Graphics2D dioda = (Graphics2D)g;
   int x1 = 85;
   int x2 = 135;
   int y = 3;
   int width = (getSize().width/9)-6;
   int height = (getSize().height-1)-6;
  
   if (counter3.OVF = true)
   {
   dioda.setColor(Color.RED);
   dioda.fillOval(x1, y, width, height);
   dioda.fillOval(x2, y, width, height);
   }
  if (counter3.OVF = false)
  {
   dioda.setColor(Color.WHITE);
   dioda.fillOval(x1, y, width, height);
   dioda.fillOval(x2, y, width, height);
  }
  }
  public static void main(String[] arg)
  {
   new Komponent();
  }
  }
  </code></pre>
  
  <p>what is wrong with that code?</p>