JFrame: isFocusOwner()
import javax.swing.JFrame; public class Main { public static void main() { JFrame f = new JFrame(); boolean b = f.isFocusOwner(); } }