首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
下面的应用程序中有一个组,组内有4个单选按钮,请在画线处填入正确的语句使程序能正确运行。 import javax.swing.*; public class OneTeam extends JFrame { JRadioB
下面的应用程序中有一个组,组内有4个单选按钮,请在画线处填入正确的语句使程序能正确运行。 import javax.swing.*; public class OneTeam extends JFrame { JRadioB
admin
2010-02-22
39
问题
下面的应用程序中有一个组,组内有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://kaotiyun.com/show/lanp777K
本试题收录于:
二级Java题库NCRE全国计算机二级分类
0
二级Java
NCRE全国计算机二级
相关试题推荐
以下属于容器类控件的是()。
使用SQL语句将学生表S中年龄(AGE)大于30岁的记录删除,正确的命令是()。
下面关于算法的叙述中,正确的是()。
在VisualFoxpro中,如果希望一个内存变量只限于在本过程中使用,说明这种内存变量的命令是()。
在考生文件夹下完成下列操作:(1)建立一个文件名和表单名均为oneform的表单文件,表单中包括两个标签控件(Label1和Label2)、一个选项组控件(Optiongroup1)、一个组合框控件(Combol)和两个命令按钮控件(Comman
考生文件夹下的自由表employee中存放着职员的相关数据。(1)利用表设计器为employee表创建一个普通索引,索引表达式为“姓名”,索引名为xm。(2)打开考生文件夹下的表单文件formone,然后设置表单的Load事件,代码的功
下面描述中,不属于软件危机表现的是()。
使用turtle库的turtle.fd()函数和turtle.seth()函数绘制一个等边三角形,边长为200像素,效果如下图所示。请结合程序整体框架,补充横线处代码。importturtleas①foriinrange(②):t.set
软件设计包括软件的结构、数据接口和过程设计,下列选项中属于软件的过程设计的是
随机试题
检验政策结果的必要途径是()
Pickouttheappropriateexpressionsfromtheeightchoicesbelowandcompletethefollowingdialoguesbyblackeningthecorresp
患者,男,27岁。小便热涩刺痛,尿色深红,夹有血块,心烦,舌苔黄,脉滑数。其治法是
房屋权属证书遗失的,权利人应当及时登报声明作废,并向登记机关申请补发,登记机关应当作出补发公告,经()个月无异议的方可予以补发房屋权属证书。
职工因工致残被鉴定为5级的,可享受的待遇有()
运用剩余法评估待拆迁改造的再开发地产时,其开发建筑成本费用包括()。
根据监察法律制度的规定,下列属于调查措施的有()。
从管理层次角度看,投资中心是最高一级的责任中心。()
某企业2014年向其主管税务机关申报收入150万元,成本、费用共计160万元,全年亏损10万元。经审核,成本、费用真实,收入无法核准。当地税务机关确定的应税所得率为20%,该企业2014年应缴纳的企业所得税为()。
味觉出汗综合征是()。
最新回复
(
0
)