← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #667296]: Java FX app: using SikuliX features in handlers freezes UI

 

Question #667296 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/667296

    Status: Open => Answered

RaiMan proposed the following answer:
1. to let a Thread dynamically access content in the caller, you either
have to use the ThreadContext feature or add a constructor to the Thread
class (what I usually do):

public class Workroutine extends Thread {

Object someCallerStuff = null; // replace with the type needed

public WorkRoutine(Object someCallerStuff) {
   this.someCallerStuff = someCallerStuff;
}

now you can access someCallerStuff in the run method.

BTW: It is very consuming to create a new thread every time needed. In
such a sequential situation you might create it once and then reuse it.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.