← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #240806]: Threading issue in swing GUI with type()

 

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

Description changed to:
My code runs fine when executing just this method

http://pastebin.com/XPhZc0Zc

but when I try and call it from within a gui it falls over on
s.type(...)

Any help would be appreciated!

[log] App.open C:/Program Files (x86)/Mozilla Firefox/firefox.exe(4664)
[log] CLICK on L(642,529)@S(0)[0,0 1920x1080]
java.lang.IllegalThreadStateException: Cannot call method from the event dispatcher thread
	at java.awt.Robot.checkNotDispatchThread(Unknown Source)
	at java.awt.Robot.waitForIdle(Unknown Source)
	at org.sikuli.script.RobotDesktop.mouseDown(RobotDesktop.java:76)
	at org.sikuli.script.Region._click(Region.java:2320)
	at org.sikuli.script.Region.click(Region.java:2198)
	at org.sikuli.script.Region.keyin(Region.java:2718)
	at org.sikuli.script.Region.type(Region.java:2678)
	at tradefunctions.main(tradefunctions.java:18)
	at GUI.actionPerformed(GUI.java:188)
	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)
	at javax.swing.JComponent.processMouseEvent(Unknown Source)
	at java.awt.Component.processEvent(Unknown Source)
	at java.awt.Container.processEvent(Unknown Source)
	at java.awt.Component.dispatchEventImpl(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
	at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
	at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Window.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.awt.EventQueue.access$200(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
	at java.awt.EventQueue$4.run(Unknown Source)
	at java.awt.EventQueue$4.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
	at java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.run(Unknown Source)

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.