Backing up from a Method to Its Call


Under some circumstances, it might be useful for you to step back in your code. For example, if you hit a breakpoint and would like to see how the code leading up to that breakpoint works, you can remove (pop) the current call from the call stack to re-execute the method.

You can open the Call Stack window to view all of the method calls within the current chain of method calls in the current thread. The current call is marked with the icon. Other calls in the stack are marked with the icon.

To back up to a previous method call:

  1. Open the Call Stack window (Alt-Shift-3).

  2. Right-click the line in the Call Stack window that represents the place in the code that you want to return to and choose Pop to Here.

    The program counter returns to the line where the call was made. You can then re-execute the method.

When you pop a call, the effects of the previously executed code are not undone, so reexecuting the code might cause the program to behave differently than it would during normal execution.




NetBeans IDE Field Guide(c) Developing Desktop, Web, Enterprise, and Mobile Applications
NetBeans IDE Field Guide(c) Developing Desktop, Web, Enterprise, and Mobile Applications
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 279

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net