Starting a Debugging Session
The following steps explain how to start debugging of the current project. This project must have been compiled inside the Java WorkShop and with the -g option. The current project must be an applet or standalone program. If not, the Debugger control is disabled.
To start debugging of the current project:
- Click the Debugger control

on the WorkShop tool bar.
The following actions occur.
- The WorkShop launches the Source Editor with your program sources loaded (if the sources are available). A breakpoint is set in the first line of the init method if your project is an applet or main if your project is a standalone program. The line is highlighted in red. The WorkShop runs the project to the breakpoint, then stops execution. The line with the breakpoint changes from red to green to indicate where program execution stopped. You can now set additional breakpoints.
If init or main are not defined, the WorkShop issues a warning message. You will not get an initial breakpoint.
- The WorkShop opens the Debugger's Threads/Stack tab. This tab lists the thread groups that make up the current project. The thread that contains the breakpoint is highlighted. For a description of the glyphs in this tab, see the Threads/Stack Tab.
- If your project is an applet, the WorkShop launches a second browser. You execute the applet in this browser using the Resume All command in the Source Editor or Threads/Stack tab.
By default, the WorkShop launches the Applet Viewer, in which you can execute only the applet you are debugging. If you would rather launch a full Web browser, open the Debug/Browse tab in the Project Manager and click the Java WorkShop Browser radio button in the For Applet Debugging Use field. This browser takes longer to load than the Applet Viewer, but it allows you to display applets other than the one you are debugging and to show the entire HTML page of the applet.
Note
On Windows 95 and Windows NT, when the browser that runs the applet is suspended at a breakpoint, it does not respond to window operations, such as repainting. To manipulate the browser under these circumstances, do one of the following:
- Press Alt-Tab to front the browser.
- Press Control-ESC to pop-up the task list.
- Move the browser before you start debugging the applet. The browser remains at the original position.