Siêu thị PDFTải ngay đi em, trời tối mất

Thư viện tri thức trực tuyến

Kho tài liệu với 50,000+ tài liệu học thuật

© 2023 Siêu thị PDF - Kho tài liệu học thuật hàng đầu Việt Nam

Web Application Developer’s Guide phần 3 pot
MIỄN PHÍ
Số trang
25
Kích thước
225.2 KB
Định dạng
PDF
Lượt xem
1828

Web Application Developer’s Guide phần 3 pot

Nội dung xem thử

Mô tả chi tiết

Working with applets 4-15

JBuilder and applets

If all is well, you will see your applet running in appletviewer. If not,

look in appletviewer’s console to read the error messages.

• If there is a “can’t find class” error, verify your deployment.

• If there is a runtime exception, such as NullPointerException, debug

your code to find the error.

Testing in the browsers

Always test your applet in the browsers after deploying it to the server.

This is critical to ensure that all the classes you need for the applet are

deployed properly to the server and that the <applet> tag and server

deployment match.

Here are a few tips for testing in the browser:

• Be sure the browser has Java enabled. Refer to the browser’s online

help for details.

• Don’t use the browser’s Reload or Refresh button after recompiling and

deploying your revised applet. The browser may continue to load the

old applet version from the cache.

• Use the Java Console to read the browser’s error messages. To open the

Java Console:

• Select Communicator|Tools|Java Console in Netscape.

• Select View|Java Console in Internet Explorer.

For more information, see “Solving Common Applet Problems” in the

Java Tutorial, “Writing Applets” at http://java.sun.com/docs/books/

tutorial/applet/problems/index.html.

JBuilder and applets

JBuilder provides a variety of tools for developing your applet:

• An Applet wizard for quickly creating an applet.

• A designer for visually designing an applet user interface.

• JBuilder’s AppletTestBed for running and debugging applets.

• Sun’s appletviewer for running and debugging applets.

For more information on creating applets in JBuilder, see

• “Tutorial: Building an applet” in Introducing JBuilder

• “Designing a user interface” in Designing User Interfaces with JBuilder

4-16 Web Application Developer ’ s Guide

JBuilder and applets

Creating applets with the Applet wizard

JBuilder provides the Applet wizard to generate the basic code for an

applet. To create an applet using the Applet wizard complete the

following steps.

Caution If you’re creating an applet for the Web, see “Browser issues” on page 4-5

for information on browser and JDK compatibility issues before designing

your applet.

1 Choose File|New Project to create a new project for your applet. The

Project wizard appears, suggesting a default project name and

directory. Change the project file name and the project directory if you

want to give the project a particular name and location. Click the

Generate Project Notes File option to create a descriptive HTML file for

your project.

Note The paths for the project files are pre-set in the default project

properties. Until you become a more advanced Java user, it’s best to

leave these unchanged. For more information on the default project

properties, see “Creating and managing projects” in Introducing

JBuilder.

The name of the package for the project is derived from the project file

name and is displayed in the Applet wizard. For example, if you create

a project called /<home>/<username>/jbproject/appletproject1/

appletproject1, the Applet wizard suggests using a package name of

appletproject1.

For more information on packages, see “Packages” in Introducing

JBuilder.

2 Click Next to continue to Step 2 of the Project wizard. Note the paths:

The Output, Backup and Working Directory paths and the JDK path

can be edited by selecting the ellipsis button. The Source and Test paths

Output path Where the class files and applet HTML file are

saved.

Backup path Where the backup files are saved.

Working directory The project’s working directory.

Source path Where the source files are saved.

Test path Where the test files (for unit testing) are saved.

Documentation path Where the documentation files are saved.

Tải ngay đi em, còn do dự, trời tối mất!