I want to redraw a JPanel while my program is running. Here's a fragment of my code:
public class Graph extends JPanel{
public void redrawSomething()
{
getGraphics().drawRect(15, 5, 20, 5);
repaint();
}
I tried to call "redrawSomething" but nothing happend. How do I fix it? Is something wrong?