- 2
- 0
- 约1.75万字
- 约 55页
- 2017-02-06 发布于重庆
- 举报
第18章applet和多媒体
* Case Study: Bouncing Ball, cont. Ball BallControl BounceBallApp Run * What is Multimedia? Multimedia is a broad term that encompasses making, storing, retrieving, transferring, and presenting various types of information, such as text, graphics, pictures, videos, and sound. Multimedia involves a complex weave of communications, electronics, and computer technologies. It is beyond the scope of this book to cover multimedia in great detail. This chapter concentrates on the presentation of multimedia in Java. Whereas most programming languages have no built-in multimedia capabilities, Java was designed with multimedia in mind. It provides extensive built-in support that makes it easy to develop powerful multimedia applications. Javas multimedia capabilities include animation that uses drawings, audio, and images. Optional * The URL Class Audio and images are stored in files. The .URL class can be used to identify the files on the Internet. In general, a URL (Uniform Resource Locator) is a pointer to a resource on the World Wide Web. A resource can be something as simple as a file or a directory. You can create a URL object using the following constructor: ? public URL(String spec) throws MalformedURLException ? For example, the following statement creates a URL object for : ? try { URL url = new URL(); } catch(MalformedURLException ex) { } ? Optional * Creating a URL for Local Files The following statement creates a URL object for the file c:\book\image\us.gif. ? try { URL url = new URL(c:\\book\\image\\us.gif); } catch(MalformedURLException ex) { } ? The preceding statement creates a URL for the absolute file name c:\book\beep.au on the Windows. There are two problems: (1) the file location is fixed; (2) it is platform-dependent. To circumvent these problems, you can create the URLs for files using through the resource of the class file using the java.lang.Class class. * Creating a URL from a Class Reference Whenever the Java Virtual Machine loads a class o
您可能关注的文档
最近下载
- 内科住培基地工作汇报.pptx VIP
- 3.2.2 光合作用 课件生物学七年级下册(共30张PPT).pptx VIP
- 年产8000吨塑料颗粒项目环评环境影响报告表(新版环评).pdf VIP
- 山西省太原市2025-2026学年上学期期末八年级物理试卷及答案(含答案).pdf VIP
- 人教版高中物理选择性必修第三册期末复习全册知识点考点提纲.docx
- 2025年山东化工职业学院单招语文考试题库及答案解析.docx VIP
- 国外油藏描述及方案编制的启示.pptx VIP
- 精神科暴力行为防范与处理.pptx
- 2025年山东化工职业学院单招数学考试模拟试题及答案解析.docx VIP
- 2025-2026学年新教材高中生物期末综合检测卷新人教版必修1 .pdf VIP
原创力文档

文档评论(0)