The paint () method is called automatically by the environment (usually a web browser) that contains the applet whenever the applet window needs to be redrawn. This happens when the component is first displayed, but it can happen again if the user minimizes the window that displays the compon...
A.dr aw( ) B.update( ) C.repaint( ) D.paint() 相关知识点: 试题来源: 解析 【解析】 Applet根本没有draw这个方法,而update方法是用 来更新容器,很多时候我们重绘的时候会重写这个 方法,repaint方法是进行窗体重绘,paint是绘制窗 体. 所以应该是A 反馈 收藏 ...
import java.awt.*; import java.applet.*; import java.lang.*; public class exl2_3 extends Applet{ private TextField tf; private Button btn; public void init(){ tf=new TextField(25); add(tf); btn=new Button("确定"); add(btn); resize(250,200); } public void paint(Craphics g){...
import java.awt.*; import java.applet.*; import java.1ang*; public class exl3_3 extends Applet{ private TextField tf; private Button btn; public void init(){ tf=new TextField(25); add(tf); btn=new Bunon("统计"); add(btn); resize(250,200); } pubhc void paint(Graphics g){ ...
对此,书中的解释是:But if you try to call comp.repaint()in this program, you’ll find that the panel is only repainted after the addBall method has returned. 2. Testing, repaint with paint 查了相关文档,发现paint和repaint的区别还是很大的。Paint方法一般在UI事件的callback中被调用,以进行组件...