title: Repaint() cannot make a static reference to a non static method?
body: <p>am having trouble with some code which I have been writing. I am trying to change from Main to a paintComponent method, but it says cannot make a static reference to a non-static method. I think I understand what it is saying, but I am unsure how to get around this. The class is as below:</p>
  
  <pre><code>import javax.swing.JFrame;
  import java.awt.Graphics;
  
  public class Main extends JFrame{       
      /**
       * 
       */
      private static final long serialVersionUID = -4511248732627763442L;
  
      public static void main(String[] args){     
  
          frame();        
          repaint();      
          move();         
      }
  
      public static void frame(){
  
          JFrame frame = new JFrame("Hunter VS Hunted");          
          frame.setExtendedState(JFrame.MAXIMIZED_BOTH);          
          frame.setVisible(true);                             
          frame.setResizable(false);                          
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);       
  
  
      }
  
      public void paintComponent(Graphics g){
  
          super.paintComponents(g);   
          Hunter.paint(g);            
          Hunted.paint(g);            
  
  
      }
  
      public static void move(){
  
          Hunter.move();          
          Hunted.move();                      
  
      }
  }
  </code></pre>
  
  <p>Hunter and hunted in this class are two external classes. The error is occurring in the main method, on repaint() and any advice/direction would be much appreciated!</p>