转自:http://blog.csdn.net/leeshuqing/article/details/8636211
关键的四行代码,连续调用窗体的四个方法即可:
repaint();validate();invalidate();validate();