Mega Code Archive
Categories
/
Java Tutorial
/
Swing Event
Use isFocusOwner to determine whether a particular component has the focus
import javax.swing.JFrame; public class Main { public static void main() { JFrame f = new JFrame(); boolean b = f.isFocusOwner(); } }