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:
static Container container;
public FrameConstractor()
{
...
container = getContentPane();
...
}
public static void refreshMethod()
{
container.repaint();
}
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!
I think your problem can be solved by changing refreshMethod to: