by Bill Rowley
As one of the earliest (and best-priced) commercially available Java-integrated development environments, Symantec's Café quickly became quite popular. Along with that popularity, though, comes a reputation as a product that is difficult to learn. By exploring the features and capabilities of Café, this chapter can help you jumpstart your Java programming using Café.
The purpose of this chapter is to explain the usage and customization of Café. Do not expect any Java code fragments or Java applets--there won't be any.
NOTE: Even though this chapter focuses solely on Café, you can still learn Java with the help of Café. First follow the instructions in the remainder of this chapter to obtain, install, and start Café. With Café running, choose Help, Intro to Java Programming, and then follow the built-in tutorial.
Okay, you've heard a lot about Java and its potential. You thought "Hey!
I can do that!" and you downloaded a copy of the Sun Java Development Kit (JDK).
You wrote a Java program or two using a text editor (like Notepad or Wordpad) to
key in the source and the JDK command-line interface to compile and run it. You may
even have tried to use the JDK debugger. Now you're frustrated and asking yourself,
"What's the deal here? Java on the Net is so cool, but programming in Java is
a real drag! There must be a better way!" Well, there is a better way and it's
shown in Figure 54.1. Welcome to Symantec Café.
FIG. 54.1
Start enjoying Java at Café!
Café is an Integrated Development Environment, or IDE, specifically designed for use with the Java language. An IDE is a set of tightly coupled tools that work together to help programmers write, compile, test, and manage programs and projects. Café is available for the Windows 95, Windows NT, and Macintosh operating systems.
NOTE: The instructions and examples given in this chapter apply to the 1.51 version of Café for Windows 95/NT.
Component | Description/Usage |
Toolbar | The main control of Café. It provides access to all of the other components. |
Workspaces | Tabbed folders of pre-defined window layouts. |
AppExpress | Project-starting wizard that walks you through the creation and file setup of a new Java project. |
Café Studio | Easy-to-use visual designer for creating graphical user interfaces to your Java programs. |
Project Manager | Graphically organizes and manages source files associated with a project. |
Source Editor | Full-featured text editor for adding or modifying Java code or HTML. |
Class Editor | Three-paned window that graphically organizes classes, class members, and the source code of the class members. |
Hierarchy Editor | Displays and lets you edit class relationships in a tree diagram. |
Compiler | Symantec's own optimized Java compiler. |
Debugger | Lets you visually trace and manipulate Java programs as they execute. |
Expression Evaluator | Calculates the value of a Java expression from within the Source, Data, or Inspector Views of the Debugger. |
Just-In-Time Compiler | Speeds Java execution within Café and the AppletViewer by converting Java bytecode into platform-native code. |
Parser | Running in a background thread, the Parser tracks changes in the source code so that each component is always using the current code. |
Help | Standard Windows-type, context-sensitive help files. |
JDK | Sun Microsystems Java Development Kit Version 1.0.2. |
Like many Web-related products, you have several choices of where to purchase Café. Symantec sells Café on CD-ROM through computer stores, mail-order outlets, and just about anywhere else that software is sold. Café can also be purchased electronically and downloaded through the Internet. Current retail price per copy is between $100 and $130 U.S. dollars.
NOTE: Because Symantec uses the familiar InstallShield utility to install Café on your system, this chapter does not include installation details.
NOTE: Life (and hypertext links) on the Internet moves at a very fast pace and is subject to change without notice. Should Symantec decide to change their Web site these instructions may no longer be completely accurate. That's why these instructions include few direct URL addresses.
As of this writing, the most current release version is 1.51. Don't worry if you have a prior version because, along with Café, you also receive a one-year subscription for updates and fixes from Symantec. In the package with the CD-ROM should be a card that explains the Subscription Center and lists the User ID and Password assigned to your copy of Café.
To upgrade your version of Café, following the instructions listed under the "Here's how to access the Subscription Center at Java Central" heading on the card won't help you much since they are probably wrong. Try this instead:
TIP: Make a copy of the subscription information card (or at least the User ID and Password). Store it somewhere that it will be safe (and where you will be able to find it later).
Now that you have installed or upgraded to the most current version, it's time to learn about Café's tool set. This section familiarizes you with the basics of the tools that control Café itself: the Toolbar and the Workspace. Each section also shows you how to customize the controls to match the way you prefer to work.
TIP: You'll learn much more from the remainder of this chapter if you have Café up and running while you read this book.
The first window that opens when Café is started is the toolbar (or main
window), as shown in Figure 54.2. The toolbar, which opens along and across the top
of the desktop, provides access to, and control of, the other components of Café.
The remaining desktop area is left available for the Workspace.
FIG. 54.2
Café's Toolbar provides a central point of control for Café's components.
Looking at Figure 54.2, you can see that the toolbar is divided into four sections:
The Menu Bar
FIG. 54.3
Café's Menu bar lets you access each of Café's major controls and their
submenus.
TIP: Browsing through the menu items and their submenus now can help you perform the tasks presented in the "Customizing the Toolbar and Other Tricks" and "The Workspace" sections later in the chapter.
The Build Toolbox
FIG. 54.5
The Build Toolbox is where you find the buttons that let you build, compile, or
test your Java code.
Moving from left to right, the buttons on the Build Toolbox include:
NOTE: Building versus compiling--what's the difference? Very simply put, compiling is converting the Java program source code into a class file. Building is a process that not only compiles the Java source code of the active program but also any other program that needs re-compilation to reflect changes made to the project.
Again moving from left to right, the icons on the View Toolbox include:
The icons on the Views Toolbox are not buttons; single-clicking them will do nothing. There are two ways to use the icons:
Double-clicking the View icons launches the component but the component's window (called a View) may open on top of another component's window. Use the drag-and-drop method if you want the component window to open at a particular location within the Workspace. You identify the location by dragging and then dropping the View icon onto the Workspace where you want the upper-left corner of the component window.
NOTE: From here on, the term View is used to refer specifically to Café's component windows available through the Views Toolbox.
Start with the Menu Bar
Move Up. Moves the selected tool toward the top of the list. Delete. Removes the tool from the list. Now the Toolboxes
FIG. 54.8 Congratulations, you've just undocked the toolbox and changed it into a floating
window! Floating windows always stay on top of other windows regardless of which
window is active, so they don't disappear. While you have it undocked, trying moving
the toolbox around. You can also re-size the toolbox windows by grabbing and dragging
the toolbox window frame.
FIG. 54.9 The first entry on the pop-up menu, Dockable, controls how the toolbox window
will behave when it is dropped onto the toolbar window. With Dockable selected (indicated
by the check mark), the toolbox window re-integrates itself into the toolbar when
dropped back onto the toolbar. The toolbar should now look like Figure 54.10.
TIP: If the toolbox did not re-dock itself into the toolbar, check the
Dockable setting using the Toolbox pop-up menu. The toolbox will not re-dock unless
Dockable is selected.
FIG. 54.7
Use this dialog to customize your Tools Menu.
Move Down. Moves the selected tool toward the bottom of the list.
Add. Opens a standard Windows Add dialog box. Use the dialog box to browse for
the application you are adding. Once you find the application program, double-click
it to bring it into the Tool Settings dialog box.
The undocked Build Toolbox is now a floating window.
Use this menu to change the settings of the toolbox.
TIP: To keep the window floating even when dragged onto the toolbar, make
sure that Dockable is not selected.
You can set the size of the icons, tabs, or buttons on the toolbox by selecting one
of the next entries: Small, Medium, or Large.
The last entry, Reset Palette, restores any icons or buttons (but not tabs) that
have been removed from the toolbox.
CAUTION
Don't try this at home kids! Before you try to remove icons or buttons, consult
the Café Help files.
FIG. 54.10
Dropping the toolbox onto the left of the toolbar shifts the other toolbars to the
right.
Try different toolbar configurations as you work with Café. Experiment with icon and button sizes and with toolbox locations. Once you find a configuration you like, you can preserve it by choosing File, Exit & Save All.
TIP: If you over-experiment and configure things beyond all recognition, don't panic! You can restore the settings to sanity by choosing File, Exit & Discard. You can then restart Café and begin again.
In previous sections of this chapter, you have seen many references to the Workspace and are probably wondering just what it is.
If you tried the Workspace toolbox in the previous section, you saw that clicking the different tabs of the Workspace toolbox changed the configuration of the Café views on your desktop. Each tab displayed a specific set of views in a specific layout. Several of the same views appear in multiple tabs but are presented in different locations and/or sizes depending on which tab is active.
These preset configurations of views, their sizes, and locations, are called Workspaces. A Workspace can occupy all of your desktop that is not covered by the Café toolbar. Because the Workspace is wide-open in this manner, Café lets you arrange its views in a way that best matches your work style.
You can create, clone, delete, rename, or re-configure the Café Workspaces.
TIP: After you complete this section, spend some time configuring your Workspaces. Set them up to match the way you like to work. Time spent doing this now will save you time and frustration later.
FIG. 54.11
A Source Editor window, a Project Manager window, and an Output window make
up the View configuration of the Editing Workspace.
FIG. 54.12
In this example of the Editing Workspace the Source Editor window has been shortened
to match the height of the Project Manager win-dow and the Output window has been
stretched to the full width of the screen.
NOTE: Before you begin making changes, be assured that you can back out of any changes you make by choosing Environment, Workspace, Reset. This procedure restores the Workspace settings to their values at the time of the last save. Therefore, if you perform a save more than once, you cannot go back to the original settings.
FIG. 54.13
Enter a name for a new or cloned Workspace.
Renaming a Workspace
Deleting a Workspace
To work on a project within Café effectively, you need several files:
To create these files and establish a framework for working within Café,
you use the AppExpress. AppExpress is an easy-to-follow set of dialog boxes that
step you through the creation of a Café project. Choose Tools, AppExpress to call up the AppExpress dialog box (shown
in Figure 54.14). Now step through each page of the AppExpress by filling in the information and
clicking the Next button.
TIP: When specifying the application type within the AppExpress, keep in
mind these definitions:
Once you reach the Help Options screen, click the Finish button to apply
your choices and to create the project. Prior to clicking the Finish button,
you can click the Previous button to page back through the dialog and make
changes or just review your choices. At any stage of the dialog, you can click the
Cancel button to close the AppExpress dialog box and cancel the creation of the project.
NOTE: Even though AppExpress presents the Help Options screen, this version
of Café does not allow you to specify any help options.
Every programmer knows that manually tracking the parts of a project adds unnecessary
time and effort to the project. Similarly, a weak editor reduces programmer productivity
when the programmer has to fight to write the code. This section introduces you to
Café's answer to these problems--the Project Manager and the Source, Class,
and Hierarchy Editors.
TIP: Include using the Project Manager and the editors in your practice
sessions with Café. Trying them out is the only way you can assess which of
the tools works best for you.
When you ran the AppExpress, you created the files needed by Café to effectively
work on the new project. The Café Project Manager helps you organize the member
files of your project and lets you control the editors. Figure 54.15 shows Café's
Project Manager with one of the sample Java applets loaded. The folder in the left pane of the Project Manager window represents the current
project. Right-clicking the project folder invokes the pop-up menu for the project
management functions, such as Create Subproject, Build, Rebuild All, Parse All, Edit
Project, and Settings. The Project Settings option opens the Project Settings dialog
box. Most of the project settings won't need to be changed, especially if you used
AppExpress to create the project. One setting you will want to change, when your
program is completed, is the Debug/Release property. Set to Debug, Café compiles
your programs with additional hooks for the Café Debugger to use. You should
set this to Release and re-compile before putting your applet/application into a
production environment. The files listed in the right pane are, of course, the files that make up your
project. Each file lists its name, file extension, a parsed indicator, and date and
time modified. You can sort the files by any of the columns shown by clicking the
column heading button. For example, to sort the files shown in Figure 54.15 by file
extension, you click the column heading button marked "Ext." Right-clicking
this side of the Project Manager window invokes the pop-up menu for the file management
functions: Compile, Mark as Main, Remove, Attributes menu, Don't
Show menu, and Settings.
TIP: You can open a file in the Source Editor by dragging it from the Project
Manager and dropping it onto the desktop, Workspace, or the Source Editor window.
To open the file in the Class or Hierarchy Editor, drop it onto an open Class or
Hierarchy Editor window.
The Café Source Editor is a true programmer's editor. Along with the standard
new, open, save, cut, paste, search and replace, and print functions available in
most editors, Café offers powerful tools such as macros, color-coding of text,
automatic indenting, and file comparison. Figure 54.16 shows the Café Source
Editor in its full glory. Across the top of the Source Editor window is a menu bar with the self-explanatory
File, Edit, Goto, Macro, and New! menu items.
As usual, clicking a menu item activates its drop-down submenu. Below the menu bar
is a button bar with icon buttons for each of the most often used functions available
through the menu bar. From left to right the icon buttons are: New Text, Open File,
Save, Cut Text, Copy Text, Paste Text, Print, Find, Find Previous, Find Next, and
Play Default Macro. Notice the different colors of the text in the Source Editor: Comments are red,
Java keywords are blue, and all other text is black. Also take note of the indenting.
The color-coding and indenting are both done automatically while you type your code.
This makes finding syntax errors, such as improperly closed comment blocks and misspelled
keywords, a snap. The Source Editor's properties like text colors, auto-save, and undo buffer size
can be accessed and customized through the Editing/Browsing Settings dialog box (see
Figure 54.17). You call up this dialog box by choosing Edit, Text Settings.
By now you should be familiar enough with Café in particular and source editors
in general that reviewing every feature here would not be especially helpful. However,
there is one feature that is worth special mention--the Compare facility. With the
Compare facility you can match a source file against a backup copy to identify the
changes or even compare the output files from different executions of a Java application.
The Compare Files dialog box, shown in Figure 54.18, is invoked by choosing File,
Compare. Type in (or browse) the names of the files to be compared, specify how you would
like the output displayed (horizontal or vertical) and which line numbers to start
the compare with, and click OK. See Figure 54.19 for an example of the compare result.
Wouldn't it be great if you could edit the relationship, members, and source code
of a Java class all from one place? Yes, it would and Café's Class Editor, shown
in Figure 54.20, allows you to do just that. The Class Editor's three pane layout displays the classes and their relationships
in the upper-left pane, the class members in the upper-right pane, and the class
source code in the bottom pane. Double-click a class name in the Classes pane to
display the methods and data in the Members pane. The methods and data are arranged
in a collapsible hierarchy. Double-click a method or data item to display the Java
source code for that method or data item.
NOTE: You can right-click any of the panes to access the pop-up menu appropriate
for that pane.
With all of the other Café tools, and the wide amount of Java base class
documentation, the Hierarchy Editor doesn't really seem necessary. But if you are
working with a large project and you want a really neat tool to manage your project's
class relationships, the Hierarchy Editor, shown in Figure 54.21, is it. Fully parsed
Java-base classes and your project's classes are graphically displayed in a scrollable
window that shows each class name with lines connecting them by ancestry. Within the Hierarchy Editor you can open a class in the Class Editor by double-clicking
its name. To add a derived, top, or sibling class, or to connect to a base class,
right-click the class name and choose from the pop-up menu.
Café Studio's ability to visually create GUIs by simply pointing-and-clicking
and dragging-and- dropping, without having to handcraft any Java source code, is
one of Café's biggest selling points. Café Studio is the easiest to learn, most user-friendly, and most intuitive
component of Café. The online Help files for Café Studio are very well
organized and complete. But for reasons known only to Symantec's development team, Café Studio is
also virtually impossible to find and start. Because of Café Studio's ease-of-use and better-than-average documentation,
this section does not provide great detail on Café Studio itself. Instead, this
section tells you about the "gotchas" of Café Studio and gives you
the work-arounds. And of course, how to start Café Studio.
Go ahead and try to find and start up Café Studio. Did you try? Good job
if you found and started it. Don't feel bad if you couldn't; it's hidden very well.
NOTE: Café Studio stores parameters that define your GUI in a resource
file (extension RC). The Java source code to support the GUI is written into the
same source file (extension JAVA) that you edit in Café.
Choose one of these entries from the Resource submenu:
If you chose Open (and answered the Open File dialog box) or Edit,
you should see the Café Studio Resource Browser as shown in Figure 54.22. If you chose New, you should see the same Café Studio Resource Browser
with a Create Resource dialog box (see Figure 54.23). The second way to start Café Studio is to run it as a stand-alone application
apart from Café. To do this using Windows Explorer, double-click the CafeStudio
executable found in the CAFE\BIN directory. Or you can invoke it from the Run
selection of the Windows95 Taskbar.
TIP: You can add Café Studio to the Tools menu as described
earlier in the section "Customizing the Toolbar and Other Tricks." This
lets you launch Café Studio as a stand-alone application from within Café
itself.
Here are a few of the known "gotchas" in Café Studio and how to
work around them:
Work-around: Same as the work-around for the FormExpress gotcha.
Using the Café Debugger may appear difficult at first, but once you learn
the basics you should have no trouble at all. This last section provides an overview
of Café's Debugger by leading you through a brief demonstration. Pay close attention
because there will be a test--the first time you try debugging on your own.
NOTE: The sample applet CardTest is used to conduct this demonstration.
The demonstration presumes that the project has been loaded and built.
AppExpress
FIG. 54.14
Use the AppExpress dialog box to create a Java project within Café.
Cafés Project Manager and Editors
The Project Manager
FIG. 54.15
Organize your project's files in the Project Manager.
The Source Editor
FIG. 54.16
Editing is easy using Café's powerful Source Code Editor.
FIG. 54.17
Adjust the editor's properties to suit your needs.
FIG. 54.18
Specify the files to be compared in this dialog box.
FIG. 54.19
Source lines that differ are highlighted in this sample comparison.The Class Editor
FIG. 54.20
Edit a Java class's relationships, members, and source in one window--the Class Editor.
The Hierarchy Editor
FIG. 54.21
Visualize and edit class relationships with the Hierarchy Editor.Café Studio
Starting Café Studio
There are actually two ways to access Café Studio. First is through Café
itself. With a project open in Café, choose Resource to open the Resource
submenu.
FIG. 54.22
Start designing with the Café Studio Resource Browser.
FIG. 54.23
Create a new GUI resource with the Create Resource dialog box.
Gotchas and Work-Arounds
Cafés Debugger
You begin debugging a project by choosing Debug, Start/Restart Debugging or by pressing the F4 key. Café loads its Debugger and switches to the Debugging Workspace, as shown in Figure 54.24.
TIP: When working with a program that has breakpoints set from a previous session, pressing the F5 key will start the Debugger and run your program up to the first breakpoint encountered.
Let's quickly see what each button on the Debug toolbox does:
FIG. 54.24
Exterminate bugs with the Café Debugger.
FIG. 54.25
The buttons on the Debug toolbox let you control the Café Debugger.
Except for Restart Debugging, none of the Debug toolbox buttons are active unless your program is executing. You must start (or restart) debugging before they will have any effect.
TIP: You can also set and clear breakpoints when the program is not executing by using the pop-up menu within the Source Editor window. Activate the pop-up menu by right-clicking your mouse on the target line of code.
Now that you have the Debugger running and know more about the Debug toolbox, set a breakpoint and step through some code. First, set the breakpoint:
FIG. 54.26
CardTest.java with debugging Break- point set.
Now click the Go Until Breakpoint button to execute the program up to, but not
including, the first breakpoint. The next line of code to be executed is marked by
a small black arrow to the left of the line (see Figure 54.27). Notice that the AppletViewer
starts up but, because you set the breakpoint before any paint or show operation,
AppletViewer has nothing to display.
FIG. 54.27
Debugger has stopped at the breakpoint.
Also note the pop-up box within the source code. This box is a Value Tip. While debugging, you can use Value Tips to quickly find out the value of a variable, as long as the variable is within the scope the line be executed. Simply pause your cursor over a variable within the Source view and the Value Tip will appear.
TIP: You can adjust the amount of time the cursor must be on the variable before the Value Tip appears, or turn them off and on using the Debug Settings Dialog. Choose Debug, Settings, and the General tab to access the Value Tip controls.
Take a look at Figure 54.28. There are now three Source Editor windows cascading
towards the bottom-right of the screen. Look closely at the file names in the title
bar of each Source Editor window. These files are the java.lang package's source
code itself. Thanks to Café's background parsing, you can step through the Java
package sources included within your code as well as your code. Unless you plan to
modify the Java packages, or you really want to know how they work, this feature
won't help you too much. You can avoid stepping through all the Java package code
by setting more breakpoints and clicking the Go Until Breakpoint button from the
Debug toolbox.
FIG. 54.28
Source Editor windows cascade as you step through the java.lang package source code.
Go ahead and step through some lines of code. Watch these areas of the Debug Workspace as you do:
Imagine the best of Café's tools brought together with a visually oriented development tool. An environment that allows you to build Java applications simply by dragging and dropping visual elements onto a form. One where object interactions are defined just by pointing and clicking. This vision is the promise of Symantec's Visual Café.
NOTE: As of this writing Visual Café is not yet available as a production quality release. The information and examples shown here are based the Preview Release 2 version (see Figure 54.29) and therefore subject to change. Even though the Visual Café preview is available for download, Symantec recommends using Café for important development work until the production version of Visual Café is released.
Despite the Café family name, Visual Café takes a different approach to Java development. Café itself centers on the creation and testing of Java code, with the building of the GUI handled separately by Café Studio. With Visual Café the focus is on the concurrent, interactive development and testing of the GUI and the supporting Java code. By stepping you through the building of a Java applet, this section will introduce you to these new features and functions of Visual Café:
The VCafeTest applet used in this example will consist of a single window with three components:
When started, the VCafeTest applet will display an empty TextField and two buttons. When clicked, the SayIt! button will display a message in the TextField. Clicking the Quiet! button will clear the message from the TextField. True, this applet may seem rather dull, but its purpose is to demonstrate the capabilities of Visual Café, not to win awards.
Much like Café, the first step in building an applet using Visual Café is to create the various files that Visual Café uses to enable you to build your applet. These files are grouped together under a project name. With Visual Café running, perform these steps to create and name your applet:
FIG. 54.30
Create the new project by selecting a project template from the New Project Template
Dialog.
FIG. 54.31
Visual Café's Edit Workspace contains a window for project management, a
form editor, and, hidden under the form editor window, an object property list.
FIG. 54.32
Use the Property List for the applet object to name the applet.
That's it! You've created and named the project and its applet.
NOTE: This preview version of Visual Café does not update all of the project files with the changed applet name. The example1.html file must be updated manually to reflect the new applet name or the AppletViewer and the Debugger will not work. To edit the example1.html: Right-click the mouse on the example1 file in the Project Window and choose Edit Source from the pop-up menu. Change the applet tag to match the name of your applet.
Now that you have established the project and its supporting files, it is time to compose and create the GUI for the applet. As stated earlier, the VCafeTest applet will only have three components--the AWT TextField component and two AWT Button components. Start by adding the TextField component:
TIP: You can fine tune the sizing and placement of an object by editing the Dimensions attributes found in the object's Property List.
FIG. 54.33
After adding the buttons and positioning each of the components, the VCafeTest applet
should look similar to this.
At this point the VCafeTest applet will compile and would run, but clicking either the SayIt! or the Quiet! button would have no effect. If you were using Café to create this applet you would have to manually add your own Java code to the applet to make the buttons work. With Visual Café, though, you can accomplish this by using the Interaction Wizard.
Follow these steps to define the interactions between the TextField components and the two buttons:
FIG. 54.34
Start the Interaction Wizard by connecting the components that interact.
FIG. 54.35
Define the who, what, and when of component interaction using the Interaction
Wizard dialog.
FIG. 54.36
Now define the how of component interaction using the next page of the Interaction
Wizard dialog box.
Clicking the Finish button generates all of the necessary Java code to support the SayIt! button's control of the TextField component and adds it to the applet's source code file. To finish building the VCafeTest applet repeat these steps, selecting the Quiet! button and the "Clear the TextField" action.
As you can see, the Interaction Wizard dialog allows for more complex interactions using different events, objects to interact with, and actions to take. Try using the Interaction Wizard with different objects and scroll through the events and actions to learn how powerful this tool can be.
TIP: You can also invoke the Interaction Wizard dialog by right-clicking an object in the Project Window or the Form Editor and selecting Add Interaction from the pop-up menu.
The final, and probably most exciting, step of building the applet is testing it. And now it's time to let you in on a secret --you could have tested and debugged the applet at any point throughout the creation process! Since Visual Café generates Java source code in real-time, any changes you made through the Form Editor or the Interaction Wizard became instantly available for compiling and testing. This feature eliminates all the switching back and forth between Café and Café Studio necessary when testing or debugging the GUI using Café.
To build, compile, and execute the VCafeTest applet choose Project, Execute
from the Visual Café menubar or just press Ctrl+F5. Just like Café, Visual
Café will first check the project for any dependencies, compile the necessary
modules, and start AppletViewer. If you've followed the directions carefully, your
VCafeTest applet should look like the VCafeTest applet shown in Figure 54.37.
FIG. 54.37
The finished VCafeTest applet shown running in the AppletViewer.
Another way to test the applet is to just start the Visual Café Debugger. You start the Debugger one of three ways: by choosing Project, Run to Breakpoint; pressing F5; or by clicking the Run to Breakpoint button on the Debug Toolbox (refer to Figure 54.31).
TIP: It's always a good idea to save your work as you go along, but it's especially important to save the project before debugging. Early versions of a debugging tool like Visual Café's Debugger can be fragile creatures. If a bug in your code were serious enough to crash Visual Café you could lose any changes made since you last saved the project.
Again like Café, when the Debugger is started, Visual Café will switch to the Debug Workspace, check the project for any dependencies, compile the necessary modules, and start AppletViewer.
Using the Visual Café Debugger is much like using the Café Debugger. Set Breakpoints within the source code using the Source or Class Editor. Monitor the Call Stack, Variables, and Threads in their own windows while the Debugger runs. Like Café, Visual Café also provides controls such as Run to Breakpoint, Pause debugging, Stop debugging, Step Into, Step Over, Step Out, and Toggle Breakpoint on the Debugging toolbox.
Go ahead and experiment with each of the debug controls as well as the rest of Visual Café. Don't forget to use the Help files if you get stuck, but do keep in mind that some of the help may be incomplete or unavailable until the production version of Visual Café.