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=15With the debugger stopped on the second line, you can create a normal watch on the variable
dim
. If you then
create a fixed watch on this variable, it is created
on 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 set a fixed watch:
![]() |
You can also create a fixed watch on a variable in the Variables pane. Select the variable, right-click, and choose Create Fixed Watch. |
See also | |
---|---|
Watching the Value of a Variable or Expression
Deleting a Watch Variable or Expression |