- 1、本文档共10页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 5、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 6、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 7、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 8、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
09030220尹郦外文翻译
北京邮电大学世纪学院
毕业设计(论文)文献翻译
题 目 基于SWING组件技术的电子词典的
设计与实现
学生姓名 尹咨郦 学 号
专业名称 计算机科学与技术 年 级 2009级
指导教师 陈沛强 职 称 讲 师
所 在 系(院) 计算机科学与技术
2013 年 3 月 1 日
Menus and Toolbars
Excerpted from Java Swing(2Nd Edition)(OReilly)by Marc Loy,Robert Eckstein etc.
The JMenuBar Class
SwingsJMenuBar class supersedes the AWTMenuBar class. This class creates a horizontal menu bar component with zero or more menus attached to it. JMenuBar uses theDefaultSingleSelectionModel as its data model because the user can raise, or activate , only one of its menus at a given time. Once the mouse pointer leaves that menu, the class removes the menu from the screen (or cancels it, in Swing lingo), and all menus again become eligible to be raised Figure 14-4 shows the class hierarchy for the JMenuBar component.
Figure 14-4. JMenuBar class diagram
You can add JMenu objects to the menu bar with theadd( ) method of theJMenuBar class. JMenuBar then assigns an integer index based on the order in which the menus were added. The menu bar displays the menus from left to right on the bar according to their assigned index. In theory, there is one exception: the help menu. You are supposed to be allowed to mark one menu as the help menu; the location of the help menu is up to the LF. In practice, trying to do this results in JMenuBar throwing an Error.
Menu Bar Placement
You can attach menu bars to Swing frames or applets in one of two ways. First, you can use thesetJMenuBar( ) method of JFrame, JDialog, JApplet, or JInternalFrame:
JFrame frame = new JFrame(Menu);
JMenuBar menuBar = new JMenuBar( );
// Attach the menu bar to the frame.
frame.setJMenuBar(menuBar);
The setJMenuBar( ) method is analogous to thesetMenuBar( ) method ofjava.awt.Frame. Like its predecessor, setJMenuBar( ) allows the LF to determine the location of the menu (typically, it anchors the menu bar to the
您可能关注的文档
- 08050327_政通_开题报告.doc
- 080512_课程计_企业人事管理信息系统(全).doc
- 081120214素娟:浅谈张爱玲及其作品的悲剧意识.doc
- 0820601311蒋楚楚管理信息系统设计.doc
- 081230工业工培养方案.doc
- 08724135 珏 开题报告.doc
- 08《软件工程课程计》指导书.doc
- 08土木5、6班毕设计指导书.doc
- 08届高的考复习语文模拟试题.doc
- 08年10月自考财报表分析试题y以及答案.doc
- 2026届陕西省西安市西北工业大学附属中学高三语文第一学期期末联考试题含解析.doc
- 2026届四川省绵阳东辰国际学校语文高三第一学期期末联考试题含解析.doc
- 2026届四川省广元市万达中学、八二一中学语文高三第一学期期末监测试题含解析.doc
- 山东省惠民县第二中学2026届英语高三第一学期期末预测试题含解析.doc
- 湖北省四地七校考试联盟2026届高一上数学期末教学质量检测试题含解析.doc
- 江苏省如皋中学、徐州一中、宿迁中学三校2026届高三英语第一学期期末质量检测试题含解析.doc
- 2026届河南省鹤壁市浚县二中语文高三上期末经典试题含解析.doc
- 2026届湖北省武汉为明实验学校英语高三第一学期期末监测试题含解析.doc
- 陕西省西北工业大学附中2026届英语高三上期末达标检测试题含解析.doc
- 2026届浙江省杭州市第四中学高一数学第一学期期末联考模拟试题含解析.doc
文档评论(0)