题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2023-11-08 02:07:54

[填空题]下列程序中,实例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);    }   =

更多"下列程序中,实例tat是监听器,fr是事件源,fr上发生的事件委托ta"的相关试题:

[填空题]下列程序中,实例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);    }   =
[填空题]下列程序中,实例tat 是监听器,fr是事件源,fr上发生的事件委托tat进行处理。程序的执行结果是显示一个粉红色的窗口,单击关闭按钮,可关闭窗口。请将程序补充完整。
import java. awt.*;
import java. awt.event.*
public class Testppppublic 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 WindowAdapterpublic voidWindowClosing (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);


[单项选择]下列程序实现了2个监听器接口:ActionListener和W1ndowListener。 import java.awt.*; import java.awt.event.*; public class ex39______ { public static void main(String[] args) { ex39 obj = new ex39( ); obj .go( ); } public void go( ) { Frame f = new Frame("ex39"); f.addWindowListener(this); Button b = new Button("Button"); b.addActionListener(this); f.add(b); f.pack( ); f.setVisible(true); } public void actionPerformed(ActionEvent e) { System.out.println("Button pressed!"); } public void windowActivated(WindowEvent e){} public void windowDeactivated(WindowEvent e){} public void windowClosed(WindowEvent e) {} public void windowClosing(WindowEvent e){System.exit(1); public void windowIconified(WindowEvent e){} public void windowDeiconified(WindowEvent e) {} public void windowOpened(WindowEvent e){} } 请选择正确的语句填入横线处。
A. extends ActionListener, WindowListener
B. implements ActionListener, WindowListener
C. implements ActionListener; WindowListener
D. extends ActionListener; WindowListener
[填空题]JDBC驱动程序实例将应用程序中基于______的Java方法转换为数据库实例能够理解的命令。

我来回答:

购买搜题卡查看答案
[会员特权] 开通VIP, 查看 全部题目答案
[会员特权] 享免全部广告特权
推荐91天
¥36.8
¥80元
31天
¥20.8
¥40元
365天
¥88.8
¥188元
请选择支付方式
  • 微信支付
  • 支付宝支付
点击支付即表示同意并接受了《购买须知》
立即支付 系统将自动为您注册账号
请使用微信扫码支付

订单号:

请不要关闭本页面,支付完成后请点击【支付完成】按钮
恭喜您,购买搜题卡成功
重要提示:请拍照或截图保存账号密码!
我要搜题网官网:https://www.woyaosouti.com
我已记住账号密码