问答题

程序如下:
∥Java_2. java
import
java. awt. *;
import java. awt. event. * ;
public class Java_2 extends Frame{
public
Java_2( String s){
super(s);
}
public static
void main( String args[ ] ){
Java_2
fr=new Java_2 ("Testing");
Button
b=new Button( "Please press me!");
∥********** Found ************
b. addActionListener( (3) );
fr. add(b);
fr.
setSize(200,200);
fr.
addWindowListener( new WindowAdapter( ){
public void windowClosing( WindowEvent e){
System. exit(0);
}
});
∥********** Found **********
fr. setVisible( (4) );
}
}
class HandleButton implements
ActionListener{
public void
actionPerformed (ActionEvent e){
System. out. println("The button is pressed!");
}
}
【参考答案】
true[分析] 第一处表示为Button b注册监听器,根据题目条件可知 HandleButton是b的监听器,所以第......
(↓↓↓ 点击下方‘点击查看答案’看完整答案 ↓↓↓)