# New Watch Dialog Box

The New Watch dialog box enables you to specify variables or expressions to watch continuously when debugging an application. You open this dialog box either by choosing Debug > New Watch or by right-clicking a variable in the Source Editor and choosing New Watch. When you open the dialog box from the Source Editor, the Watch Expression field contains the name of the variable that the insertion point is on.

When you create a watch, the value of the variable or expression is immediately evaluated and displayed in the Watches window. The value is based on the current context. When you change the current context, the Watches window is updated to show the value of the watch for that context.

In some cases, the debugger assigns a pound sign (`#`) and a number as the value of the watch. This number is a unique identifier of the given instance. You can use this identifier to determine if a variable points to the same or to a different instance.

When you specify an expression to watch, follow the syntax rules of the debugger that you are using.

Related Topics

Developing Applications with NetBeans IDE,

Developing Applications with NetBeans IDE,

Developing Applications with NetBeans IDE,

Copyright © 2015, Oracle and/or its affiliates. All rights reserved.