电脑桌面
添加小米粒文库到电脑桌面
安装后可以在桌面快捷访问

计算机外文翻译--菜单和工具栏

计算机外文翻译--菜单和工具栏_第1页
1/9
计算机外文翻译--菜单和工具栏_第2页
2/9
计算机外文翻译--菜单和工具栏_第3页
3/9
中文 1972 字 毕业设计(论文)文献翻译 题 目 学生姓名 学 号 专业名称 计算机科学与技术 年 级 2025 级 指导老师 职 称 讲 师 所 在 系(院) 计算机科学与技术 2025 年 3 月 1 日Menus and ToolbarsExcerpted from "Java Swing(2Nd Edition)(O'Reilly)"by Marc Loy,Robert Eckstein etc.The JMenuBar ClassSwing'sJMenuBar 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 diagramYou 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 L&F. In practice, trying to do this results in JMenuBar throwing an Error.Menu Bar PlacementYou 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( )...

1、当您付费下载文档后,您只拥有了使用权限,并不意味着购买了版权,文档只能用于自身使用,不得用于其他商业用途(如 [转卖]进行直接盈利或[编辑后售卖]进行间接盈利)。
2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。
3、如文档内容存在违规,或者侵犯商业秘密、侵犯著作权等,请点击“违规举报”。

碎片内容

计算机外文翻译--菜单和工具栏

确认删除?
VIP
微信客服
  • 扫码咨询
会员Q群
  • 会员专属群点击这里加入QQ群
客服邮箱
回到顶部