Read an Excerpt
PREFACE: Preface
Many Web authors want to focus on content and not on the underlying programming logic that drives interactivity, but still reap the benefits of giving their documents the dynamism that programming provides. For the most part, Web authors have had to write CGI scripts, use scripting languages (JavaScript, VBScript), or learn enough about the Java programming language to write applets to make content dynamic. Java Studio eliminates the need to learn and use scripting languages or Java code. How it accomplishes this isn't important, and if you'd rather drive than know what's going on under the hood, this book is for you.
This book is also for Java experts who do want to write code, but who want to create parts of their programs quickly. Programmers who use Java Studio will find that codeless programming is a convenient way to create prototypes or rapidly develop parts of the application for inclusion in the larger application. They can even choose to develop the entire application in Java Studio.
From its early days, the World Wide Web has been a great place to put documents for public consumption. With the arrival of browsers, information consumers could see that content in a richer and more navigable form. But Web pages were often flat, albeit electronically linked, pages. Now, of course, many sites offer searching, online shopping, data, user input, video, sound, and many more types of interactivity.
How have content developers incorporated such dynamic behavior into Web pages? There are a number of ways: CGI programs, JavaScript functions, Activex controls, and Java applets, to name a few.
CGI stands for Common Gateway Interface and is a programming interface for gateway programs. That may sound circular, so let's look at it in pieces. Gateway programs accept and handle requests from Web servers on behalf of users. When you decide to visit a Web site by entering a URL or following a link, a Web server handles your request and loads a Web document written in HTML. But there is a whole body of information that cannot be contained in an HTML file, dynamic information in the form of electronic mail or databases, for example. You need a gateway to those streams of information. That's where CGI comes in; it provides programmers with an interface for writing programs that can accept a request from a Web server, then access one of those other streams of information, and return the information to the Web server. The Web server then passes it back to you in your browser. Whew. The operative word here is "program." If you don't know how to write a program or would rather spend time on content, CGI scripts leave a lot to be desired.
JavaScript is relatively easy to use, but it doesn't offer the possibilities of a full programming language like Java. Activex controls are not portable, which means that you can't expect them to work on all platforms and in all browsers. Java applets are versatile, but until now they still required you to write Java code.
Many business now use internal webs, or intranets, to disburse information and applications. Both Java applets, which run in browsers or are launched by browsers, and Java applications, which run outside of browsers, can provide interactivity and programming power in those environments. Java Studio makes it possible to write Java applets without writing a single line of code. Java Studio also makes it possible to write entire standalone applications without writing a single line of code.
Who Should Use Java Studio by Example
This book is for anyone who wants to create applets, applications, and JavaBeans components using Java Studio. Java Studio's visual programming model allows you to select building blocks, called components, and connect them to form a working program. Some of the types of users who would want to learn how to use Java Studio include:
- Web designers and Webmasters.
- Content creators and developers.
- Casual and full-time programmers.
Part I introduces you to Java Studio. Chapter 1 shows how Java Studio can be useful for you. Chapter 2 covers product features and how to use them. Chapter 3 describes how to generate programs from designs and distribute the finished results.
Part II forms the heart of the book. It includes ten chapters of examples that can guide your efforts or that can serve as starting points for your own projects. You can follow along as the examples illustrate different kinds of projects, and you can take the designs illustrated there and modify them for your own use.
Part III contains three appendixes of reference material: a complete reference for all of the components in Java Studio, a guide to exchanging components between Java Studio and the Java WorkShop development environment, and a list of resources for Web developers, designers, and Java users.
Conventions Used in This Book
Table P-1 shows the typographic conventions used in this book.
Table P-1 Typographic Conventions
Typeface or Symbol
Description
Indicates information to make a note of as you work with Java Studio.
Denotes a tip to make your work in Java Studio easier.
Indicates a warning to heed before or while you do something in Java Studio.
courier
Indicates a command, directory, file name, environment variable, class name, method, argument, Java keyword, HTML tag, file content, or code excerpt.
bold courier
Indicates a command-line entry.
italics
Indicates a new term that is defined when it is introduced, emphasis, a book title, a variable that you should replace with a valid value, a user- provided name of a GUI element, or the name of a Java Studio design.
Bookman Light
Indicates something that you type in the fields in dialog boxes in the examples.
Using the Java Studio by Example CD-ROM.
The companion CD-ROM contains the examples used in this book, an HTML page with URLs for Web authoring and Java resources, and "Try and Buy" free, 30-day trial software for Java Studio. This is the full Java Studio product with the JDK 1.1.3. It is not a "light" version of the product. You can use it to do real work.
All of the examples in this book are on the CD-ROM. You have the option to do the exercises in the book or to just copy the example files to your hard drive, open them in Java Studio, and follow along in the exercises. To use the CD-ROM, install Java Studio and then install the examples.
System Requirements.
To use Java Studio 1.0, your system should meet these requirements:
- Microsoft Windows 95 or Windows NT 3.51 and 4.0.
- Pentium/100 MHz minimum; Pentium/133 MHz recommended.
- 32 Mbytes memory minimum.
- 85 Mbytes temporary space needed to install, 33 Mbytes installed footprint.
- Minimum screen resolution: 800x600.
- (Optional) sound card for multimedia examples.
- Solaris 2.5, 2.5.1, and 2.6 (SPARC).
- SPARCstation, 10 minimum; SPARCstation 5 with color monitor recommended.
- 32 Mbytes memory.
- 23 Mbytes free disk space, 80 Mbytes temporary space needed to install, 40 Mbyte installed footprint.
- OSF/Motif 1.2.3 window system.
- Solaris 2.5, 2.5.1, and 2.6 (Intel).
- Pentium/100 MHz minimum; Pentium/133 MHz recommended.
- 32 Mbytes memory.
- 23 Mbytes free disk space, 76 Mbytes temporary space needed to install, 38 Mbyte installed footprint.
- OSF/Motif 1.2.3 window system.
- (Optional) sound card for multimedia examples.
Installing Java Studio on Windows NT and 95 Systems
1. Quit any other programs that you are running.
2. Determine if you have the needed amount of available disk space. The installed version of Java Studio 1.0 requires 33 Mbytes (56 Mbytes of free space during the install).
To find out the amount of available disk space you have, follow these steps:
a. Open the My Computer window. b. Click on the icon of the disk drive where you want to install Java Studio 1.0 (usually C:). c. Look at the bottom of the window to read how much space is available on the disk you selected.
3. Insert the Java Studio by Example CD-ROM into your CD-ROM drive. If your system automatically reads the CD in the drive, click Next and skip to step 4.
If your system does not automatically read the CD-ROM drive, follow these steps:
a. Double-click on the CD-ROM drive (usually D: or E:). b. Double click on the WIN32 folder to open it. c. Double-click on the Setup.exe application icon.
The Java Studio 1.0 Setup Welcome window opens and welcomes you to the setup program.
4. Follow the instructions on the screen to install Java Studio 1.0.
5. After the installation is complete, double-click on the Java Studio icon to start the product. (The installation creates a program group containing all the icons and places the Java Studio icon on the desktop. It also includes Java Studio in the Windows Programs menu.)
6. When Java Studio loads for the first time, you will be prompted to enter a serial number. Click on the "30-day trial" button; a serial number will be entered automatically.
7. To uninstall Java Studio, double-click the uninstall icon in the Java Studio program group.
8. To install the examples provided on the CD-ROM, follow the directions in "Installing the Examples" on page xxix.
Installing Java Studio on Solaris Systems
1. Make sure that your system meets the requirements described in "System Requirements" on page xxvi.
2. Insert the Java Studio by Example CD into your CD-ROM drive.
3. If Volume Manager is running on your machine, the CD-ROM is automatically mounted to the /cdrom directory. Skip to step 4. If the Volume Manager is not running on your machine, create a directory called /cdrom/jsbe#1 and mount the CD-ROM manually by becoming root and typing: # mkdir -p /cdrom/jsbe#1 # mount -rF hsfs /dev/dsk/c0t6d0s0 /cdrom/jsbe#1 # exit
4. Change to the directory where you intend to install the Java Studio files: % cd /installation_directory
5. Uncompress and extract the Java Studio files by typing: % zcat /cdrom/jsbe#1/platform_dir/ JS1.0.platform.tar.Z