一般不是用repaint方法吗?
http://java.sun.com/docs/books/tutorial/uiswing/index.html

解决方案 »

  1.   

    那么,paintComponent()方法时候会用到呢?
      

  2.   

    http://www.csdn.com.cn/program/3049.htm
      

  3.   

    void   paint(Graphics g) 
              Invoked by Swing to draw components.  void paintComponent(Graphics g) 
              Calls the UI delegate's paint method, if the UI delegate is non-null. 
      

  4.   

    那么,paintComponent()方法时候会用到呢?
    -------------------------------------------
    在组件上画的时候
      

  5.   

    看你使用的是awt包中的组件,还是swing 包中的组件。
    awt中使用paint()
    swing中使用paintComponent()
      

  6.   

    两个你都可以用,只要在前面import别搞错了就ok,重要的是里面的内容看你怎么写.
      

  7.   

    void   paint(Graphics g) 
              Invoked by Swing to draw components. 
     void paintComponent(Graphics g) 
              Calls the UI delegate's paint method, if the UI delegate is non-null. 
    -----------------------------------------------------------------------------------
    可不可以再详细说一下,我有点不太明白。如果有例子程序,就更好了:),谢谢!