Preventing a Window from Gaining the Focus

If Window.setFocusableWindowState(false) is called on a window, neither the window nor any of its children components can gain the focus. However, components like buttons can still invoke actions.

On some platforms, if the non-focusable window is the only window visible in the application, the non-focusable window will gain the focus. However, none of the children components will gain the focus.

frame.setFocusableWindowState(false);

Post a comment

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image. Ignore spaces and be careful about upper and lower case.