List of usage examples for javax.swing JComponent isRequestFocusEnabled
public boolean isRequestFocusEnabled()
true
if this JComponent
should get focus; otherwise returns false
. From source file:Main.java
/** * Request focus on the given component if it doesn't already have it * and <code>isRequestFocusEnabled()</code> returns true. *///from w w w.java 2 s. co m public static void adjustFocus(JComponent c) { if (!c.hasFocus() && c.isRequestFocusEnabled()) { c.requestFocus(); } }