0

Is there any cross-platform way to figure out which window is at a certain point on the screen?

If there is not, what would be the equivalent function to getWindowAtPoint for linux (X11?) and OS X?

Jeremy Salwen
  • 8,061
  • 5
  • 50
  • 73

1 Answers1

0

There is functionality in Swing to identify the component at a given point. There is no support in the Java Runtime for inquering about other windows, but the robot-classes can grab screenshots.

What do you need to do?

Thorbjørn Ravn Andersen
  • 73,784
  • 33
  • 194
  • 347
  • I am actually trying to implement the functionality of a macroing program (http://www.kaitnieks.com/scar which uses getWindowAtPoint). It is not very important, but I was wondering if there would be a way to do it in java. – Jeremy Salwen Jun 28 '09 at 05:37
  • 1
    If it is a non-java Window you want to work with, you cannot do that with the capabilities of Java 6. You will need to use a library that talks to the operating system with JNI or JNA. I do not know of such a library :( – Thorbjørn Ravn Andersen Jun 28 '09 at 14:32