extends Screen will make it work but why...
Hi RaiMen,
It's me again...I am trying to make my extension working now,
In the first case, I kind of wrote it like this,
public class extendFuncs extends Region{
public int GetHome() throws Exception{
int i;
for(i=0;i<3;i++){
type(Key.ESC);
wait(2.0);
}
return 0;
}
}
And while executing my script, I got a null Pointer exception. I guess it's caused by _robot(right?).
So I modified the code like this in order to initialize _robot, in the second case,
public class extendFuncs extends Region{
public extendFuncs(){
Rectangle r = new Screen(
Region.
}
public int GetHome() throws Exception{
int i;
for(i=0;i<3;i++){
this.
this.wait(2.0);
}
return 0;
}
}
And now, I will get a FindFailed exception...
Finally, I wrote it like this, in the third case,
public class extendFuncs extends Screen{
public int GetHome() throws Exception{
int i;
for(i=0;i<3;i++){
type(Key.ESC);
wait(2.0);
}
return 0;
}
}
and now it's working but why? I notice that class screen extends class region but _robot is private...
As a starter of Java, I am almost lost now...
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Ethan.kwok for more information if necessary.