What I'd like you to do is to change the program so that it loops five times rather than three. How would you go about doing that? Well, the easiest way would be to change the count variable to the value 5, so let's do that.
q 8.5(a) Double-click on the count variable in the Variables view.
A dialog will pop up, as shown in Figure 8.32.
Use this dialog to change the value to 5.
q 8.5(b) Enter the value 5 and click OK.
You'll be returned to the workbench, where you will see that the value of the count variable has been changed to 5.
The last thing to do now is to restart the program and let it execute with the new value. There are several tool buttons in the Debug view that will allow you to single-step, step into a function, step out of a function, and so on. In this case, you simply want the program to resume execution (and presumably to finish). You can do this by using the Resume tool, as shown in Figure 8.35.
q 8.5(c) Click the Resume tool to continue execution of the program.
And the result? As you can see in Figure 8.36, the program now executes its loop five times, printing Hello 3 and Hello 4. This is exactly what we wanted to have happen, and thus our debugging was a success!
So now that you've managed to enter source code, run a program, set a breakpoint, and modify the execution, you're ready to use the tool to do some real programming. In the next two steps, you will build a simple user interface and then connect it to a database. By the time you are done, you will have built a functioning application!
Before we exit here, though, we have one last thing to do: return to the Java perspective. I think the easiest way will be to close the Debug perspective. Use the Perspective Bar on the left of the workbench.
q 8.5(d) Right-click on Debug in the Perspective bar and select Close.
This will close the Debug perspective and return you to the last open perspective, the Java perspective, as shown in Figure 8.38.
Okay, you've written, run, and debugged a very simple application. Time to put a little more meat on it. First, a user interface: that's the task for Step 9.