Java expressions are used in the Watches window, Inspector windows, Breakpoint Conditions, and Breakpoint Log Expressions. The following are examples of acceptable legal Java expressions you can use in the debugger:
rect
rect.width
myArray[3]
myArray.length
rect.height == 100
myArray.length > 7
rect.width * rect.height
x + y + z
frame1.enabled && frame1.visible
textField1.hasFocus || textField2.hasFocus
<my_value> instanceof java.lang.String
x << 2
y >> 1
keyEvent.modifiers & java.awt.event.InputEvent.CTRL_MASK
y>5 ? y*7 : y*4
java.awt.Color.pink
Field or method is
static and should be accessed with the class name instead
,"
displays in the Log window, when you access a static field method
using an object instance instead of the class name to flag every
static access with object instances as potentially dangerous. The
following example implies that thread t
will sleep for
xxx ms
. However, the correct meaning is that the method sleep()
is static; the entire application sleeps in this case.
Thread t = ...
...
t.sleep (xxx);
java.awt.Color
About the Debugger Windows
Copyright © 1997, 2004, Oracle. All rights reserved.