Results 1 to 4 of 4

Thread: hasFocus()

  1. #1
    carderne is offline Senior Member
    Join Date
    Nov 2007
    Posts
    160
    Rep Power
    8

    Default hasFocus()

    Is there any method to see if a JComponent currently has focus?

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default

    Hm, my magic eight ball tells me to look at the API for JComponent and its ancestors, and to search on the term "focus". It also hints that the key ancestor here is Component.

  3. #3
    carderne is offline Senior Member
    Join Date
    Nov 2007
    Posts
    160
    Rep Power
    8

    Default

    Great, thanks. I did a search in my particular component, but kind of stopped looking after the JComponent results... :/

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default

    Ah. Focus is a very primitive GUI concept so it makes sense to me that it would be handled by class high up in the ancestor hierarchy.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •