首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
请选择正确的语句填入下列程序的横线处。 import javax. Swing.*; import java.awt.*; import java.awt.event.*; public class ex46
请选择正确的语句填入下列程序的横线处。 import javax. Swing.*; import java.awt.*; import java.awt.event.*; public class ex46
admin
2008-01-11
36
问题
请选择正确的语句填入下列程序的横线处。 import javax. Swing.*; import java.awt.*; import java.awt.event.*; public class ex46 { static String str= "单击次数:"; static intcnt = 0; public static void main(String[] args) { try{ UIManager.setLookAndFeel(UIManager. getCrossPlatformLookAndFeelClassName()); } catch(Exception e) {} JFrame jf = new JFame("ex46"); JButton jb = new JButton("Button"); jb.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { cnt ++; j1.setText(str +cnt); } }); j1. setLabelFor (jb); jPanel jp = new JPanel(); jp.setBorder(BorderFactory.createEmptyBorder(25, 25, 25, 25); jp.setLayout(new GridLayout(0, 1)); jp.add(jb); jp.add (j1); jf.getContenPanel() .add(jp, "Center"); jf.pack(); jf.setVisible (true); } }
选项
A、Labelj1 = new JLabel(str + "0");
B、final JLabel j1 = new JLabel(str + "0");
C、final JLabelj1 = JLabel(str + "0");
D、JLabelj1 = new JLabel(str + "0");
答案
B
解析
转载请注明原文地址:https://kaotiyun.com/show/ronp777K
本试题收录于:
二级Java题库NCRE全国计算机二级分类
0
二级Java
NCRE全国计算机二级
相关试题推荐
数据库管理系统中负责数据模式定义的语言是
在面向对象方法中,不属于“对象”基本特点的是
下面对视图的描述中错误的是
单击表单中的命令按钮,要求弹出一个“祝考试顺利!”的消息对话框,应该在命令按钮的Click事件中编写代码()。
以下属于非容器类控件的是()。
要将显示日期值时所用的分隔符设置为竖杠“|”,错误的设置命令是
以下关于关系的说法正确的是
在VisualFoxPro中,下列关于SOL表定义语句(CREATETABLE)的说法中错误的是
下列程序在Frame中设定BorderLayout布局管理器,选择正确的语句填入程序的横线处。importjava.awt.*;publicclassex43extendsFrame{publicst
随机试题
A.近曲小管B.髓袢降支细段C.髓袢升支粗段D.远曲小管E.集合管肾小球滤液中的氨基酸被重吸收的部位是【】
神经胶质细胞的作用有
比较以下化合物构象的稳定性大小:()。
A、单纯性甲状腺肿B、结节性甲状腺肿C、慢性淋巴细胞性甲状腺炎D、甲状腺高功能腺瘤E、继发性甲状腺功能亢进易向胸骨后延伸的是
CT检查中最常用的体位是
下列关于建设项目环境影响评价文件报批的表述中,正确的是()
《社会消防安全教育培训规定》(公安部令第109号)规定国家机构以外的社会组织或者个人利用非国家财政性经费,创办消防安全专业培训机构,面向社会从事消防安全专业培训的,应当经省级教育行政部门或者()依法批准,并到省级民政部门申请民办非企业单位登记。
小孙和小陈是不同商业银行的两名员工,两人是好朋友,以下小陈的做法无误的是( )。
桌子上放着7只杯子,有3只杯口朝上,4只杯口朝下,每个人任意将杯子翻动5次,问若干人翻动后,能否将7只杯子全变成杯口朝下?如能,至少需要几个人来翻动?
我们宣传思想工作,必须以科学的理论______人,以正确的舆论______人,以高尚的精神______人,以优秀的作品______人,不断培养和适就一代又一代有文化,有纪律的社会主义新人。依次填入划横线部分最恰当的一项是()。
最新回复
(
0
)