java.awt.Window.setFocusable() doesn't do anything?

M

Mark Space

Got this from a thread below by Hal Vaughan.

java.awt.Window.setFocusable() is inherited from java.awt.Component, but
for top level windows it doesn't seem to do anything. To make a top
level window not able to be focused, one should call
setFocusableWindowState() instead.

This feels kinda bug-ish to me. Confusing to programmers to say the least.

Would one ever need to call setFocusable() on a top level container? If
not, why not have have java.awt.Window override setFocusable() and
isFocusable() to call setFocusableWindowState() and
getFocusableWindowState() instead? This seems like what most folks
would expect.

Here's the skinny on the window focus system if you want to read it:

<http://java.sun.com/javase/6/docs/api/java/awt/doc-files/FocusSpec.html#FocusableWindows>


Anyone got any ideas?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top