- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
java 第7章 图形用户界面.ppt
* 439。57秒 * 439。57秒 * 439。57秒 * 439。57秒 * 439。57秒 * 439。57秒 * 439。57秒 * 439。57秒 * 439。57秒 * 439。57秒 * 439。57秒 * * * 439。57秒 * 439。57秒 图形用户界面 * Setting Colors You can use the following methods to set the component’s background and foreground colors: setBackground(Color c) setForeground(Color c) Example: jbt.setBackground(Color.yellow); jbt.setForeground(Color.red); 图形用户界面 * 12.7 The Font Class Font myFont = Font(name, style, size); Example: Font myFont = new Font(SansSerif , Font.BOLD, 16); Font myFont = new Font(Serif, Font.BOLD+Font.ITALIC, 12); JButton jbtOK = new JButton(OK“); jbtOK.setFont(myFont); Font Names Standard font names that are supported in all platforms are: SansSerif, Serif, Monospaced, Dialog, or DialogInput. Font Style Font.PLAIN (0), Font.BOLD (1), Font.ITALIC (2), and Font.BOLD + Font.ITALIC (3) 图形用户界面 * Finding All Available Font Names import java.awt.*; public class TestFont{ public static void main(String[]args){ GraphicsEnvironment e = GraphicsEnvironment.getLocalGraphicsEnvironment(); String[] fontnames = e.getAvailableFontFamilyNames(); for (int i = 0; i fontnames.length; i++) System.out.println(fontnames[i]); }} 图形用户界面 * 12.8 Using Panels as Sub-Containers Panels act as sub-containers for grouping user interface components. It is recommended that you place the user interface components in panels and place the panels in a frame. You can also place panels in a panel. To add a component to JFrame, you actually add it to the content pane of JFrame. To add a component to a panel, you add it directly to the panel using the add method. 图形用户界面 * Creating a JPanel You can use new JPanel() to create a panel with a default FlowLayout manager or new JPanel(LayoutManager) to create a panel with the specified layout manager. Use the add(Component) method to add a component to the panel. For example, JPanel p = new JPanel(); p.add(new JButton(OK)); 图形用户界面 * Example 12.4 Testing Panels This example uses panels to organize components. The prog
您可能关注的文档
- 6第六章 像管.ppt
- 6第六章-除尘装置2011.ppt
- 6第六讲(实心圆杆扭转).ppt
- 6裴晓辉-工程胎设计2013.ppt
- 7 更新的技术信息 Nick.ppt
- 7 模式识别原理课件-第8章 神经网络模式识别法.ppt
- 7 组合体尺寸标注.ppt
- 7 非统计+精仪概述.ppt
- 7-2 燃料的合理利用与开发.ppt
- 7-8 冷却润滑系.ppt
- 中国国家标准 GB 14287.5-2025电气火灾监控系统 第5部分:测量热解粒子式电气火灾监控探测器.pdf
- 《GB/T 42706.4-2025电子元器件 半导体器件长期贮存 第4部分:贮存》.pdf
- GB/T 42706.4-2025电子元器件 半导体器件长期贮存 第4部分:贮存.pdf
- 中国国家标准 GB/T 42706.4-2025电子元器件 半导体器件长期贮存 第4部分:贮存.pdf
- 中国国家标准 GB/T 19436.2-2025机械电气安全 电敏保护设备 第2部分:使用有源光电保护装置(AOPDs)设备的特殊要求.pdf
- 《GB/T 19436.2-2025机械电气安全 电敏保护设备 第2部分:使用有源光电保护装置(AOPDs)设备的特殊要求》.pdf
- 《GB 27898.4-2025固定消防给水设备 第4部分:消防气体顶压给水设备》.pdf
- GB 27898.4-2025固定消防给水设备 第4部分:消防气体顶压给水设备.pdf
- GB/T 31270.1-2025化学农药环境安全评价试验准则 第1部分:土壤代谢试验.pdf
- 中国国家标准 GB/T 31270.1-2025化学农药环境安全评价试验准则 第1部分:土壤代谢试验.pdf
最近下载
- 2025幼儿园《防拐骗》安全教育ppt完整版.pptx VIP
- 市政工程预算编制与审核指南.docx VIP
- 《脑血管搭桥手术》课件.ppt VIP
- 病理生理学—肝功能不全.ppt VIP
- 输电线路放线紧线课件.pptx VIP
- 2023年太原学院计算机科学与技术专业《计算机网络》科目期末试卷A(有答案).docx VIP
- 沪科安徽版 八年级物理下册 第十一章 综合测试卷(2025年春).pdf VIP
- 统编版七年级语文上册《24.2蚊子和狮子》教学课件.pptx VIP
- 1.最新版历年高考必备高频词汇汇编(完整 800 词版).pdf
- 初中地理:2025年秋新教材八上《地理》必背知识(背诵版+默写版).pdf VIP
原创力文档


文档评论(0)