Java Reference
In-Depth Information
One central feature of debuggers is the ability to pause execution of the application
being debugged by adding breakpoints to it. When a line of code where a breakpoint
has been placed is about to be executed, the application pauses, allowing us to
inspect the values of all instance and method scoped variables in the class where the
breakpoint was placed. In NetBeans, placing a breakpoint in a line is very simple;
all we need to do is click on the left margin of the source editor right next to the line
where the breakpoint will be added. At this point the line will be highlighted in red
plus a red square icon will be placed in the left margin.
To make the left margin display line numbers, we need to right-click on it
and click on the checkbox labeled Show Line Numbers .
At this point we are ready to debug our application, which we can do by simply
right-clicking on our project and selecting Debug . Doing this causes our application
to be deployed and executed as in debug mode.
We need to test our application as usual in order to get to the point where it is failing.
In our example we would simply click on the Add New button in the Customer list
page, then enter some data for a new customer and click on the Submit button. At
this point the line containing the breakpoint will be reached, and our application
execution will be paused.
 
Search WWH ::




Custom Search