Using the debugger, you can locate and correct bugs in your program. The following steps introduce you to debugging in the IDE.
To step through the code:
Add Breakpoint from
the main window. Click OK in the Add Breakpoint dialog box.
The line is highlighted to indicate that a breakpoint was set.
Step Into.
A debugging session begins and the program runs until it reaches the breakpoint. The IDE switches to the debugging workspace, which displays:
The next method call is highlighted.
The first line in the main method is highlighted.
Toggle
Breakpoint.
The breakpoint is removed.
Finish. Click
OK in the Finish debugging sessions dialog box to end the debugging session.You have now completed the ColorSwitch tutorial.
| Back: Compiling and Running Your Program |