更多"下列程序中,实例tat 是监听器,fr是事件源,fr上发生的事件委托t"的相关试题:
[填空题]下列程序中,实例tat 是监听器,fr是事件源,fr上发生的事件委托tat进行处理。程序的执行结果是显示一个粉红色的窗口,单击关闭按钮,可关闭窗口。请将程序补充完整。
import java. awt.*;
import java. awt.event.*
public class Testppp
{
public static void main ( String args [])
{
Frame fr = new Frame ("The Adapter !" );
TheAdapterTest tat=new TheAdpterTest ( ):
fr. 【14】
fr. setSize (200, 200):
fr. setBackground (Color. pink);
fr. setVisble (true):
}
}
class TheAdapterTest extends WindowAdapter
{
public voidWindowClosing (WindowEvent e)
{
System.exit ( 1);
}
}
[填空题]下列程序中,实例tat是监听器,fr是事件源,fr上发生的事件委托tat进行处理。程序的执行结果是显示一个粉红色的窗口,单击关闭按钮,可关闭窗口。请填完整程序。
import java.awt.*;
importjava.awt.event.*;
public class Testppp
{
public static void main(String args[ ])
{
Frame fr=new Frame("The Adapter!”);
TheAdapterTest tat=new TheAdapterTest( );
fr 【 】
fr.setSize(200,200);
fr.setBackground(Color.pink);
fr.setVisible(true);
}
}
class TheAdapterTest extends WindowAdapter
=
public void windowClosing(WindowEvent e)
{
System.exit(1);
}
=
[简答题]请完成下列Java程序。实例listener是监听器,frm是事件源,fr上发生的事件委托tat进行处理。程序的执行结果是显示一个蓝色的窗口,单击关闭按钮,可关闭窗口。
注意:请勿改动main( )主方法和其他已有的语句内容,仅在下划线处填入适当的语句。
源程序文件代码清单如下:
import java.awt.*;
import java.awt.event.*;
public class BlueWindow
public static void main(String args[])
Frame frm=new Frame ("欢迎参加Java考试!");
TheAdapterTest listener=new TheAdapterTest( );
frm. ______;
frm.setSize(200,200);
frm.setBackground(Color.blue);
frm. ______;
class TheAdapterTest extends WindowAdapter
public void windowClosing(WindowEvent e)
System.exit(1);
[填空题]JDBC驱动程序实例将应用程序中基于______的Java方法转换为数据库实例能够理解的命令。
[填空题]在事件处理过程中,涉及的3类对象是事件、事件源和 【13】 。