Thanks. It's much easier to see what's going on we we know what the problem really is.
As I guess you have already seen, that program does something when you run it: it prints "false". So we know that the JWindow instance
is not a focusable window.
The
API documentation for isFocusableWindow() explains why that is the case: "For a Window which is not a Frame or Dialog to be focusable, its focusable Window state must be set to true, its nearest owning Frame or Dialog must be showing on the screen, and it must contain at least one Component in its focus traversal cycle". The important bit is
its nearest owning Frame or Dialog must be showing on the screen.
So what is the nearest owning Frame or Dialog of your JWindow instance (and is it showing)?
There is a JWindow constructor that lets you set the owner. But you are not using it, instead you use the no argument JWindow constructor. (the default one). It's worth while seeing what effect this has on the owner and focusability. Again the
JWindow() constructor documentation says that it "Creates a window with no specified owner. This window will not be focusable".
So the bottom line is that you have to create your JWindow with a constructor that specifies an owner for it. (And the other conditions described in isFocusableWindow() have to be met).
-----
I would strongly suggest that you work through a Swing tutorial -
Sun's is a good one - in order to see what's required and how you would go about writing the code.
There are a few things in the code you posted that ring alarm bells: variable/class naming conventions (classes should start with a capital letter, variable names should be descriptive), making the window visible with a deprecated method, making it visible from the main() thread and the focussing woes. These can be put right if you take the time to follow a (good) tutorial.