
Java Programming for absolute beginner- P17
Thông tin tài liệu:
Nội dung trích xuất từ tài liệu:
Java Programming for absolute beginner- P17 JavaProgAbsBeg-08.qxd 2/25/03 8:54 AM Page 278 278 Java Programming for the Absolute Beginner The Project: QuizShow Applet The QuizShow applet asks a series of true or false questions. The user selects either true or false and then clicks the “That’s my final answer!” button for the next question. The label at the top indicates whether the previous answer was correct. After the user answers the final question, the QuizShow applet shows the final score. The applet is driven by parameters set within the HTML. None of the ques- tions are hard coded in the applet itself. The questions are specified within the HTML parameters, which enable you to ask any number of questions by modify- ing the HTML file and without having to rewrite or recompile the applet code. Figure 8.1 shows the project for this chapter. FIGURE 8.1 The QuizShow applet asks true or false questions and shows you your score. TEAM LinG - Live, Informative, Non-cost and Genuine!Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. JavaProgAbsBeg-08.qxd 2/25/03 8:54 AM Page 279 279 Understanding Applets Chapter 8 An applet is a small program that runs embedded within another application. Popular browsers such as Microsoft Internet Explorer and Netscape Navigator support Java applets. This means that the browsers themselves are interpreting the Java byte code as part of a Web document, not the Java VM that is installed on your system that runs applications. There are often differences in how the Writing Applets browsers interpret the Java to the extent that you will notice a significant differ- ence in how the applets run. Sometimes an applet will run fine in one browser, but not in another. If you experience any difficulty running these applets in your browser, make sure you have the latest version of the Java interpreter, or Virtual Machine (VM), installed. In this chapter, I tested all my applets using the SDK’s appletviewer utility (part of the development kit included on the CD) as well as using Microsoft Internet Explorer 5 with the latest Microsoft VM installed. If you are having trouble with Internet Explorer, from the Tools menu, select Windows Update, where you will be taken to the Windows Update Web site, and look for the Microsoft Virtual Machine update if one is available. If you are using any other browser, visit your browser vendor’s Web site to get more information about the particular browser you are using and its Java support. If all else fails, use the appletviewer utility; it should work just fine. HIN T To use the appletviewer utility in Windows, Solaris, and Linux, at your command prompt type appletviewer myhtmlfile.html, where myhtmlfile.html is the HTML file that has the tags that reference your applet. The appletview- er will show only the applet itself and none of the surrounding HTML. Knowing the Difference between Applets and Applications So far in this book, you’ve dealt almost exclusively with applications. The only exposure you had to an applet was a brief example back in Chapter 1, “Getting Started.” Applications are stand-alone programs because they run on their own and are not interpreted by any program other than your computer’s Java Inter- preter. Applets are found on the Internet and are run by your browser, so they force security restrictions on applets. You wouldn’t want to surf to the wrong Web site and have your hard drive erased, would ...
Tìm kiếm theo từ khóa liên quan:
Nhập môn lập trình lập trình website lập trình ngôn ngữ html giáo trình php lập trình C++Tài liệu có liên quan:
-
Đề cương chi tiết học phần Cấu trúc dữ liệu và giải thuật (Data structures and algorithms)
10 trang 357 0 0 -
Bài tập lập trình Windows dùng C# - Bài thực hành
13 trang 204 0 0 -
Bài giảng Nhập môn về lập trình - Chương 1: Giới thiệu về máy tính và lập trình
30 trang 188 0 0 -
Giáo trình nhập môn lập trình - Phần 22
48 trang 143 0 0 -
[Thảo luận] Học PHP như thế nào khi bạn chưa biết gì về lập trình?
5 trang 137 0 0 -
8 trang 99 0 0
-
Bài giảng Nhập môn lập trình - Chương 12: Quản lý bộ nhớ
23 trang 69 0 0 -
Giáo trình Lập trình Website (Nghề Tin học ứng dụng - Trình độ Cao đẳng) - CĐ GTVT Trung ương I
156 trang 62 2 0 -
Báo cáo đồ án môn học II: Thiết kế website bán đồng hồ
25 trang 55 0 0 -
42 trang 53 0 0
-
Tạo mạng xã hội với PHP - part 43
10 trang 46 0 0 -
4 trang 43 0 0
-
Bài giảng Nhập môn lập trình: Bài 2 - Thuật toán
32 trang 42 0 0 -
Nhập môn lập trình (Đặng Bình Phương) - Các khái niệm cơ bản về hệ điều hành
17 trang 39 0 0 -
MỘT SỐ KHÁI NIỆM CƠ BẢN CỦA NGÔN NGỮ C
49 trang 38 0 0 -
Một số giải pháp lập trình ASP.NET 2.0
82 trang 38 0 0 -
LẬP TRÌNH C ++ QUẢN LÝ NHÀ TRỌ
12 trang 38 0 0 -
Câu hỏi bài tập nhập môn lập trình
11 trang 37 0 0 -
CÁC KHÁI NIỆM CƠ BẢN VỀ LẬP TRÌNH
21 trang 36 0 0 -
142 trang 35 0 0