首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
下面的应用程序中有一个组,组内有4个单选按钮,请在画线处填入正确的语句使程序能正确运行。 import javax.swing.*; public class OneTeam extends JFrame { JRadioB
下面的应用程序中有一个组,组内有4个单选按钮,请在画线处填入正确的语句使程序能正确运行。 import javax.swing.*; public class OneTeam extends JFrame { JRadioB
admin
2010-02-22
43
问题
下面的应用程序中有一个组,组内有4个单选按钮,请在画线处填入正确的语句使程序能正确运行。
import javax.swing.*;
public class OneTeam extends JFrame
{
JRadioButton[] teams = new JRadioButton[3];
public OneTeam()
{
super("One Team");
setSize (140,160);
setDefaultCloseOperation(JFrame.EXIT ON CLOSE
JPanel pane = new JPanel();
teams[0] = new JRadioButton("red choose");
teams[l] = new JRadioButton("blue choose");
teams[2] = new JRadioButton("green choose");
【 】;
for ( int i = 0;i < teams.length;i++)
{
group.add(teams
);
pane.add(teams
);
}
setContentPane(pane);
}
public static void main(String arguments[]
{
OneTeam ot= new OneTeam();
ot.show();
}
选项
答案
ButtonGroup group=new ButtonGroup()
解析
本题考查Swing常用组件单选按钮组运用的基本知识。阅读程序和由显示结果可以得出, group是一个组,而且是单选按钮组。而程序里没有group单选按钮组的创建语句,所以在空行里应该创建1个单选按钮组给group。
转载请注明原文地址:https://jikaoti.com/ti/3Ub0FFFM
本试题收录于:
二级Java题库NCRE全国计算机二级分类
0
二级Java
NCRE全国计算机二级
相关试题推荐
(1)将customerl表中的全部记录追加到customer表中,然后用SQLSELECT语句完成查询:列出目前有订购单的客户信息(即有对应的orderlist记录的customer表中的记录),同时要求按“客户号”升序排序,并将结果存储到result
(1)用SQL语句进行以下查询:查询“外汇账户”表中的日元信息。查询结果包括钞汇标志、金额,结果按金额降序排序,并存储于表two.dbf中,并将SQL语句存储于新建的three.txt文件中。(2)用一对多报表向导建立报表,“外汇代码”表为父表,“外汇账
对考生文件夹下的数据库“图书借阅”中的表完成如下操作:①为表loans增加一个字段“姓名”,字段类型为“字符型”,宽度为8。编写程序modipro.prg实现以下功能:②根据borrows表的内容填写表loans中“姓名”的字段值。③查询表loan
进行字符串比较时,使命令:?“我们大家”=“我们”结果为逻辑假的设置是()。
指定在一个文本框中如何输入和显示数据的属性是()。
以下叙述与表单数据环境有关,其中正确的是()。
下面关于表单控件的基本操作的陈述中,不正确的是()。
在考生目录下完成如下简单应用:使用一对多报表向导建立报表。要求:父表为stock_name,子表为stock_sl,从父表中选择字段“股票简称”;从子表中选择全部字段;两个表通过“股票代码”建立联系;按股票代码升序排序;报表标题为“股票持有
在VisualFoxPro中,为了将菜单作为顶层菜单,需要设置表单的某属性值为2,该属性是()。
在VisualFoxPro中,通常以窗口形式出现,用以创建和修改表、表单、数据库等应用程序组件的可视化工具称为
随机试题
可抑制肾小管对肌酐的分泌的物质是
A.疼痛B.发热C.恶心、呕吐D.腹胀E.呃逆外科术后最常见的是
项目经理部必须实行逐级安全技术交底制度,纵向延伸到班组全体作业人员。()
贷款是指商业银行或其他信用机构以一定的()和按期归还为条件,将货币资金的()转让给资金需求者的信用活动。
朱兰三部曲包括_________。
儿童在13—16岁这一时期身心各方面变化大,特别是身高的快速增长明显,已接近成人,但其心理的成熟程度却比成人要低得多。这说明儿童的发展具有()。
下列关于全国人民代表大会代表法律地位的表述,错误的是()。
Whichofthefollowingstatementsistrueaccordingtothepassage?Judgingfromthecontext,theword"they"(Line2,Paragraph
以下代码的输出结果是()。fo=open("book.txt","w")ls=[’C语言’,’Java’,’C#’,’Python’]fo.writelines(1s)fo.close()
A、BillwillgraduateinJuneevenifhefailsinhischemistrycourse.B、BillintendstodograduateworkinchemistryafterJun
最新回复
(
0
)