Everytime I try to call the repaint() method it says a non static method cannot be reference from a static method. Btw, it\'s in the same class as the paintComponent method. I t
You can't call it from main() because you can't call non-static functions (repaint()) or use non-static variables inside a static method (main()).
Instead make the main class implement Runnable and use a thread:
Thread repaintThread = new Thread("some_name", this); // \
public void run(){ // |
while(true){ // >-Theese shall be in the main class
repaint(); // |
} // |
} // /
repaintThread.start(); //this shall be in main()