Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

static method getFocusedComponent() of JTextComponent

 
Jim Martin
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all
How do I use the static method getFocusedComponent() of JTextComponent. I am using JBuilder 6.0.
I am using the class DefaultFocusManager() and I am trying to used the static method getFocusedComponent() of JTextComponent to get the component the currently has the focus.
What is another way to get the component that has the focus currently?
Thank you very much
 
Howard Zhao
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure whether this is what you are looking for:
KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner()
Howard
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic