[填空题] 阅读下面代码:import java.awt.*; public class Exam11_2 {public static void main (String args[])

[填空题] 阅读下面代码:import java.awt.*; public class Exam11_2 {public static void main (String args[]),第1张

[填空题] 阅读下面代码: import java.awt.*; public class Exam11_2 { public static void main (String args[])

[填空题] 阅读下面代码: import java.awt.*; public class Exam11_2 { public static void main (String args[]) {______;f.add("North",new Button("North"));f.add("South",new Button("South"));f.add("East",new Button("East"));;f.add("West",new Button("West"));f.add("Center",new Button("Center"));f.pack(); f.setVisible(true); } } 请在程序中的画线处添上适当的语句 【11】 ,使程序能正确执行。

正确答案:

frame f=new frame("BorderLayout")

参考解析:

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

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/5614697.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-15
下一篇 2022-12-15

发表评论

登录后才能评论

评论列表(0条)

保存