- 1、本文档共30页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 5、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 6、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 7、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 8、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
Introduction to Java Programming Chapter 12 Introduction to Java Progrmming Chapter 12 GUI Basics Chapter 12 In this chapter, you will learn the following concepts: simple GUI components role of layout managers FlowLayout, GridLayout, and BorderLayout managers Color and Font JPanel 12.1 Introduction This chapter introduces GUI components and their relationships, containers and layout managers, colors, fonts, borders, and tool tips. 12.2 GUI Components 12.2 GUI Components // Create a button with text OK JButton jbtOK = new JButton(OK); ? // Create a label with text Enter your name: JLabel jlblName = new JLabel(Enter your name: ); ? // Create a text field with text Type Name Here JTextField jtfName = new JTextField(Type Name Here); ? // Create a check box with text bold JCheckBox jchkBold = new JCheckBox(Bold); ? // Create a radio button with text red JRadioButton jrbRed = new JRadioButton(Red); ? // Create a combo box with choices red, green, and blue JComboBox jcboColor = new JComboBox(new String[]{Red, Green, Blue}); 12.2.1 Swing vs. AWT So why do the GUI component classes have a prefix J? Instead of JButton, why not name it simply Button? In fact, there is a class already named Button in the java.awt package. Swing vs. AWT When Java was introduced, the GUI classes were bundled in a library known as the Abstract Windows Toolkit (AWT). For every platform on which Java runs, the AWT components are automatically mapped to the platform-specific components through their respective agents, known as peers. AWT is fine for developing simple graphical user interfaces, but not for developing comprehensive GUI projects. Besides, AWT is prone to platform-specific bugs because its peer-based approach relies heavily on the underlying platform. With the release of Java 2, the AWT user-interface components were replaced by a more robust, versatile, and flexible library known as Swing components. Swing components are painted directly on canvases usin
您可能关注的文档
- 东华大学计算机科学与技术学院计算机系统与网络技术课件 第二十九讲.ppt
- 东华大学计算机科学与技术学院计算机系统与网络技术课件 第二十六讲.ppt
- 东华大学计算机科学与技术学院计算机系统与网络技术课件 第二十七讲.ppt
- 东华大学计算机科学与技术学院计算机系统与网络技术课件 第二十四讲.ppt
- 东华大学计算机科学与技术学院计算机系统与网络技术课件 第二十五讲.ppt
- 东华大学计算机科学与技术学院计算机系统与网络技术课件 第九讲.ppt
- 东华大学计算机科学与技术学院计算机系统与网络技术课件 第六讲.ppt
- 东华大学计算机科学与技术学院计算机系统与网络技术课件 第七讲.ppt
- 东华大学计算机科学与技术学院计算机系统与网络技术课件 第三讲.ppt
- 东华大学计算机科学与技术学院计算机系统与网络技术课件 第三十二讲.ppt
- 2024年浙江省杭州市临安市上甘街道招聘社区工作者真题及参考答案详解一套.docx
- 2024年河南省许昌市长葛市石固镇招聘社区工作者真题含答案详解.docx
- 2024年河南省郑州市登封市大冶镇招聘社区工作者真题及参考答案详解.docx
- 2024年浙江省宁波市余姚市低塘街道招聘社区工作者真题及参考答案详解一套.docx
- 2024年浙江省丽水市莲都区峰源乡招聘社区工作者真题及答案详解1套.docx
- 2024年河南省郑州市中原区石佛镇招聘社区工作者真题及答案详解1套.docx
- 2024年浙江省杭州市萧山区河庄镇招聘社区工作者真题带答案详解.docx
- 2024年浙江省嘉兴市桐乡市河山镇招聘社区工作者真题含答案详解.docx
- 2024年河南省郑州市金水区未来路街道招聘社区工作者真题参考答案详解.docx
- 2024年浙江省宁波市慈溪市观海卫镇招聘社区工作者真题及参考答案详解一套.docx
最近下载
- 物资管理知识题库-填空题.doc VIP
- Yamaha 雅马哈 乐器音响 PSR-SX600 Owner's Manual (Traditional Chinese) 用户手册.pdf
- 2025年危险性较大工程项目领导带班制度.pdf VIP
- 安徽工程大学【个人简历】简单风格四页精美套装简历-简历模板.docx VIP
- 2024年其他类-化验员-水质化验员考试历年常考点试题带答案.docx VIP
- 中国粮油公司年度经营计划.ppt VIP
- 2024年其他类-化验员-水质化验员考试历年常考点试题带答案.docx VIP
- 2024年其他类-化验员-水质化验员考试历年常考点试题带答案版.docx VIP
- 株洲湘江四桥42米现浇箱梁贝雷支架施工技术方案.doc VIP
- GB50312-2016 综合布线系统工程验收规范.docx VIP
文档评论(0)