| || |
Working with Java Object Methods
I am currently attempting to use the GUI Spy to test public java methods. My current task is to get the contents from a selected table item (JTable). However, using functions such as:
java_activate_method("Current Patient List:_1","contains",retValue,param1,param2)
java_activate_method("Current Patient List:_1","list",retValue,param1,param2);
Yeilds the following error:
Object: "Current Patient List:_1"
Error: Opereration currently not valid for the object
Either Mercury does not support the javax.swing public methods or I'm using the wrong methods to extract the contents of the selected JTable row. The Object is valid and in my GUI map.
If anyone can provide a solution, I would greatly appreciate it!!
Re: Working with Java Object Methods
You need to specify the values of param1...paramX
for example when calling JComponent's contains function (which BTW simply returns true if this component logically contains x,y)
You should use:
java_activate_method("MyJavaTable","contains", rc, 1, 2);
A more useful example is getting the value of a certain cell (row = 2, column = 3)
java_activate_method("MyJavaTable","getValueAt", retVal, 2, 3);
java_activate_method(retVal, "toString", retValStr);