Preventing a Component from Gaining the Focus
When setFocusable() is called, the user will not be able to give
the component the focus (by clicking on it or through focus
traversal), nor be able to acquire the focus.
component.setFocusable(false);
Post a comment