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

Discussion in 'Java' started by Mark Space, Jan 8, 2008.

  1. Mark Space

    Mark Space Guest

    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?
    Mark Space, Jan 8, 2008
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Thang Nguyen
    Replies:
    0
    Views:
    614
    Thang Nguyen
    Aug 7, 2003
  2. Chris Berg
    Replies:
    2
    Views:
    1,274
    Chris Berg
    Nov 4, 2003
  3. Robert Mark Bram
    Replies:
    2
    Views:
    5,953
    Robert Mark Bram
    Dec 11, 2003
  4. Arun
    Replies:
    0
    Views:
    711
  5. Vasu
    Replies:
    2
    Views:
    591
    Knute Johnson
    Oct 18, 2008
Loading...

Share This Page