在JPanel上画图,重写了paint(Graphics g)方法,将它放到JscrollPane中,拖动滚动条时,会出现重影现象。 解决方法,在paint方法的第一句加上super.paint(g);