前者一般只是重画自己;
后者一般连父容器也要重画。详细说明看下面:
摘录java.awt.Component/-----------------------------
validate()
/-----------------------------------------------
Invalidates this component. This component and all parents above it are ed as needing to be laid out. This method can be called often, so it needs to execute quickly.
/-----------------------------
repaint()
/----------------------------
This method causes a call to this component's update method as soon as possible
后者一般连父容器也要重画。详细说明看下面:
摘录java.awt.Component/-----------------------------
validate()
/-----------------------------------------------
Invalidates this component. This component and all parents above it are ed as needing to be laid out. This method can be called often, so it needs to execute quickly.
/-----------------------------
repaint()
/----------------------------
This method causes a call to this component's update method as soon as possible
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货