Click Here!
home account info subscribe login search My ITKnowledge FAQ/help site map contact us


 
Brief Full
 Advanced
      Search
 Search Tips
To access the contents, click the chapter and section titles.

Sams Teach Yourself Visual J++ 6 in 21 Days
(Publisher: Macmillan Computer Publishing)
Author(s): Rick Leinecker
ISBN: 0672313510
Publication Date: 11/01/98

Bookmark It

Search this book:
 
Previous Table of Contents Next


Q&A

Q How do you indicate that a Java applet is to be embedded into a Web page?

A You use the <APPLET> tag in the HTML file. When a Java-aware browser sees the <APPLET> tag, it knows that anything that follows is part of a Java applet’s attri-butes and its parameters.

Q What attributes are required in an <APPLET> tag?

A Three tags are required in an <APPLET> tag: CODE, HEIGHT, and WIDTH. CODE specifies the name of the applet class file. HEIGHT specifies the height of the applet window in pixels. WIDTH specifies the width of the applet window in pixels.

Q What is alternate HTML and why should you use it?

A Following any parameter tags you might use, yet before the closing </APPLET> tag, there is a special area where you can supply what’s known as alternate HTML. Here, you can enter any amount of HTML code you want; such code will be displayed only by non-Java browsers.

Although applets completely ignore alternate HTML, it’s an important part of the <APPLET> tag nonetheless. Alternate HTML gives you an opportunity to create Web pages that are useful to Web surfers regardless of the browser they happen to use. If you don’t supply alternate HTML for non-Java browsers, you run the risk of alienating these users.

Q What information do you need for an FTP program so that you can connect to a Web site?

A The first thing you need to do is to make sure that you have a valid user account. This gives you permission to upload files to the Web server. For a program such as WS_FTP, you’ll need to provide a username, a password, and the FTP server name (or IP address). This is the minimum information you’ll need in order to connect to an FTP site. There might be additional required information if you must go through a proxy server to get to your space on the Web server. (Your site administrator can give you the information you need for connecting through a proxy server.)

Q Why would you want to make your Java source code available for download?

A Many Visual J++ and Java programmers enjoy fostering an attitude of sharing with other programmers. Practically every Visual J++ programmer has at one point relied on source code found on the Web to learn how to do something for a project.

Q Why do you have to use FTP to upload files to the Web?

A You can’t use HTTP because it’s a one-way transfer. Users can only get files using HTTP. To send files to a server, you must use a trusted protocol such as FTP that requires a login name and password. Other options include using programs such as PC Anywhere.

Review Exercises

1.  Now that you know how to send your applets to the Web, create some and make them available to the public through your Web site.
2.  Create three applets that simply show some distinct text onscreen. Upload them to your Web server into a directory named Applets. Create three HTML pages. Have each of the HTML pages load in two of the three applets. Make sure that they find the applets by specifying the CODEBASE.


Previous Table of Contents Next


Products |  Contact Us |  About Us |  Privacy  |  Ad Info  |  Home

Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc.
All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited. Read EarthWeb's privacy statement.