sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #42186
Re: [Question #616486]: ERROR: Cannot call method from the event dispatcher thread
Question #616486 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/616486
Status: Open => Answered
RaiMan proposed the following answer:
Might be, that this is your code, but not all:
You seem to use some Java AWT components, since there is this:
....
at Clarity.Fn.TypeByImage(Fn.java:139)
at Clarity.Bot_Carga_DWH.Introducir_usuario(Bot_Carga_DWH.java:82)
at Clarity.Carga_Excel.carga_excel(Carga_Excel.java:157)
at Clarity.Ventana$4.actionPerformed(Ventana.java:183)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
....
which I cannot see in your code.
This problem has nothing to do with the Sikuli features.
Sikuli internally uses Java Robot for mouse, keyboard and screen capture, which cannot be used in Swing/AWT event handlers by Java design.
the solution:
put everything that uses Sikuli features in a thread and run this from the event handler (button pressed in this case).
--
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.