title: Refresh a jframe from another class
body: <p>I want to refresh(repaint) a jframe if an event in other class occurred, I use some thing like code below but somethimes this code didn't work:</p>
  
  <pre><code>static Container container;
  public FrameConstractor()
  {
      ...
      container = getContentPane();
      ...
  }
  
  public static void refreshMethod()
  {
      container.repaint();
  }
  </code></pre>
  
  <p>and I call refresh method when my event occurred; but this code repaint the frame for me some times and some times didn't do any thing!</p>