Exercise 1: Starting a Debugging Session
This exercise shows how to load the Blink project into the Debugger. If you haven't yet created and built the Blink project, you should do so now. Step-by-step instructions are in Creating a Project.
- Check the Java WorkShop tool bar for the name of the current portfolio and project.
If the current portfolio is not "personal," choose Portfolio => Choose => personal. If the current project is not Blink, choose Project => Choose => Blink.
- Click the Debugger control
on the WorkShop tool bar.
The following three actions occur:
- The WorkShop opens the Threads/Stack tab of the Debugger. This tab lists the thread groups in your program. A thread group is simply a logical grouping of related threads. In the Threads/Stack tab, you can view the variables in your program and track their values as you step through the source code. The contents of the Threads/Stack tab will be described in detail in Exercise 3.
- The WorkShop launches an Applet Viewer for Blink.class. Currently, the Applet Viewer is empty. In the next step, you will run the Blink project in this viewer.
- The WorkShop opens the Source Editor with the file Blink.java loaded. A breakpoint is set in the first line of the method init. The WorkShop runs the Blink project to the breakpoint, then stops execution. The line with the breakpoint is highlighted in green to indicate where program execution stopped. The reason for stopping in init is to give you the opportunity set additional breakpoints.
- Click the Resume All control
on the Source Editor tool bar.
The WorkShop executes the Blink project in the Applet Viewer. The Threads/Stack tab is updated. In the Source Editor, the line with the breakpoint changes to red.
Next lesson:
- Exercise 2: Setting a Breakpoint