栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 笔试题库

[填空题] 阅读下面代码: import java.awt.*; public class Exam11

笔试题库 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

[填空题] 阅读下面代码: import java.awt.*; public class Exam11

[填空题] 阅读下面代码: import java.awt.*; public class Exam11_1 { private frame f; private Button b1,b2,b3,b4; public static void main(String args[] { Exam11_1 that = new Exam11 1 (); that.go(); } public void go() { ______; f.setLayout(new FlowLayout()) ;; b1 = new Button ("Button 1"); b2 = new Button ("Button 2"); b3 = new Button ("Button 3"); b4 = new Button ("Button 4"); f.add (b1); f.add (b2); f.add (b3); f.add (b4); f.pack (); f.setVisible (true);} } 请在程序中画线处填写正确的语句 【13】 ,以便编译运行程序后得到正确的结果。

正确答案:

f=new frame("GUI example")

参考解析:

本题考查容器和布局管理器的基本知识,属于综合题。在本程序里,缺少建立frame的语句,而且该frame的名字为GUI example,而4个按钮的布局方式被压缩至最小,因此是 FlowLayou布局方式。

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/481505.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号