dcsimg

How can I determine the active JFrame?

Tomaz Strazisnik

Call Frame.getFrames() which will return all frames created by the application.

Frame[] f = Frame.getFrames();
Frame active = null;
for (int i = 0; i < f.lenght; i++) {
  if (f[i].isActive()) {
    active = f[i]; 
    break;
  }
}