0

I have an application with multiple windows. Is it possible to get the windows in the front or that is in focus without keeping track?

  • I tried that but it doesn't work me, I get the following error can not make static reference to the non static method of getFocusOwner() – Global Tool R Apr 13 '16 at 18:26

1 Answers1

1

You can generate this information using the following:

Window windows[] = Window.getWindows();
for (Window w) {
  if (w.isFocused()) {
     ...
  }
  else if(w.isActive()) {
     ...
  }
}
ControlAltDel
  • 33,923
  • 10
  • 53
  • 80