Repaint() doesn't clear the frame

前端 未结 3 406
故里飘歌
故里飘歌 2020-12-19 18:45
public class Graphics2DTest extends JPanel implements ActionListener{
private Timer time = new Timer(5,(ActionListener) this);
int x = 0,y = 0;
public void paintComp         


        
3条回答
  •  春和景丽
    2020-12-19 18:58

    You need to repaint the background each time as well. Add code to paint the background before you paint the rectangle.

提交回复
热议问题