Visual cues to represent lost focus on tree, table, etc.

Discussion in 'Java' started by B Young, Nov 14, 2003.

  1. B Young

    B Young Guest

    Open most any native Windows app and deactivate the window or swap
    between controls inside the app and you'll immediately notice that
    when a component like a tree or table loses focus, the renderers
    change from typically a dark blue background to a light grey
    background, emphasizing the loss of focus. This has several usability
    advantages.

    JTable, JTree, etc. don't have this behavior by default. Their
    renderers do have a boolean hasFocus parameter you can use to change
    the background color yourself, but this falls apart in a multiple
    selection environment since the hasFocus parameter is per renderer,
    not per the whole tree or table.

    I'm either missing something pretty obvious, or this is just going to
    be a total focus subsystem nightmare to implement completely from
    scratch.

    Thanks
    B Young, Nov 14, 2003
    #1
    1. Advertising

  2. B Young

    B Young Guest

    Hmm, perhaps I should have phrased this more as a question. But, I've
    searched the net for several days and haven't found a single post with
    anybody talking about this particular concern with Swing.

    The importance of this feature becomes obvious with certain scenerios.
    Assume you have a basic GUI with a toolbar, JTree and JTable. The
    toolbar has a delete button. The delete button can be used against a
    node in the tree, or a row in the table, depending upon which
    component has focus. You are really going to mess with the user's
    head if you can't show a visual cue to indicate which component (the
    treel or table) has focus.

    Any feedback on how to accomplish this in an elegant fashion would be
    appreciated.

    (B Young) wrote in message news:<>...
    > Open most any native Windows app and deactivate the window or swap
    > between controls inside the app and you'll immediately notice that
    > when a component like a tree or table loses focus, the renderers
    > change from typically a dark blue background to a light grey
    > background, emphasizing the loss of focus. This has several usability
    > advantages.
    >
    > JTable, JTree, etc. don't have this behavior by default. Their
    > renderers do have a boolean hasFocus parameter you can use to change
    > the background color yourself, but this falls apart in a multiple
    > selection environment since the hasFocus parameter is per renderer,
    > not per the whole tree or table.
    >
    > I'm either missing something pretty obvious, or this is just going to
    > be a total focus subsystem nightmare to implement completely from
    > scratch.
    >
    > Thanks
    B Young, Nov 16, 2003
    #2
    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. puzzlecracker
    Replies:
    4
    Views:
    568
    John Harrison
    Sep 19, 2005
  2. Kevin Walzer

    Re: PIL (etc etc etc) on OS X

    Kevin Walzer, Aug 1, 2008, in forum: Python
    Replies:
    4
    Views:
    389
    Fredrik Lundh
    Aug 13, 2008
  3. Xah Lee
    Replies:
    0
    Views:
    468
    Xah Lee
    Feb 12, 2009
  4. Roger
    Replies:
    3
    Views:
    322
  5. timothytoe

    Appropriate clues and cues

    timothytoe, Mar 14, 2008, in forum: Javascript
    Replies:
    2
    Views:
    87
    timothytoe
    Mar 14, 2008
Loading...

Share This Page