Watching the Value of a Variable or Expression

You can watch the value of a variable while debugging your program by adding its name to the Watch pane of the Debugger window. If you are running the JPDA, you can also watch the value of an expression.

To watch a variable or expression:

  1. From the main window, choose Debug Add Watch (Shift-F8).

  2. In the Add New Watch dialog box, type the variable or expression to watch.

  3. Click OK.

  4. To view the value of the variable or expression, open the Watches pane of the Debugger and select the item.
You can also set a watch by selecting the variable or expression directly in the Source Editor, right-clicking, and choosing Add Watch or by right-clicking the Watches node in the Debugger window.
See also
Creating a Fixed Watch
Viewing Variables in the Current Context

Legal Notices