Creating a Fixed Watch

See Also

A fixed watch describes the object that is currently assigned to a variable while a normal watch describes the content of the variable. Fixed watches are specific to the Java 2 debugger.

For example, consider the following code:

java.awt.Dimension dim=new java.awt.Dimension(10,20);
java.awt.Dimension newDim=dim;
dim=new java.awt.Dimension(20,30);
newDim.height=15

With the debugger stopped on the second line, you can create a normal watch on the variable dim. If you create a fixed watch on the variable dim, the watch describes the object that is currently assigned to the variable, which is java.awt.Dimension(10,20)). If you press F8 to step over the code three times, the value of the normal watch becomes java.awt.Dimension(20,30). This change occurred on the third line of source code. The value of the fixed watch is java.awt.Dimension(15,20). The fixed watch was created on the object with a height of 10, but the fourth line changed the height of this object to 15.

To create a fixed watch:

See Also
Creating a Watch
Variables and Expressions in the IDE

Legal Notices