Mouse position: Difference between revisions

→‎{{header|Kotlin}}: Updated example see https://github.com/dkandalov/rosettacode-kotlin for details
(Added Kotlin)
(→‎{{header|Kotlin}}: Updated example see https://github.com/dkandalov/rosettacode-kotlin for details)
Line 517:
=={{header|Kotlin}}==
{{trans|Groovy}}
<lang scala>// version 1.1.12
 
import java.awt.MouseInfo
Line 525:
Thread.sleep(1000)
val p = MouseInfo.getPointerInfo().location // gets screen coordinates
println("${it}: x = ${"%-4d".format(p.x)} y = ${"%-4d".format(p.y)}")
}
}</lang>