Java examples for Swing:Screen
get Focused Window
//package com.java2s; import java.awt.*; public class Main { public static Window getFocusedWindow() { for (Window w : Window.getWindows()) { if (w.isFocused()) { return w; }/* ww w .j a v a 2s . co m*/ } return null; } }