you need to pass an instance of the Graphics to the method.for example:jp.paintComponent(g);

解决方案 »

  1.   

    but complier tell me that Graphics is an abstract class,
    can not be instanced
      

  2.   

    of course, Graphics can't be instanciated directly. 
    But you can use some other methods to create Graphics instance.For example, Graphics g = new JLabel("Hello World").getGraphics();there are many other methods such as create an image and then get the Graphics