How does a JTextPane grab forus?

I have a JTextPane and some other buttons on a frame. How do I make the JTextPane as the default forus? In addition, I want to let the JTextPane grab forus when the user click it. How can I do this?I found the method grabForus() doesn't work.
[257 byte] By [youhaodiyia] at [2007-11-27 10:03:08]
# 1
try using: -jTextPane.requestFocusInWindow()
c0demonk3ya at 2007-7-13 0:38:03 > top of Java-index,Desktop,Core GUI APIs...
# 2

> I want to let the JTextPane grab forus when the user click it. How can I do this?

You don't do anything special. The component automatically gets focus when you click on it.

If you need further help then you need to create a "Short, Self Contained, Compilable and Executable, Example Program (SSCCE)",

see http://homepage1.nifty.com/algafield/sscce.html,

that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.

Don't forget to use the "Code Formatting Tags",

see http://forum.java.sun.com/help.jspa?sec=formatting,

so the posted code retains its original formatting.

camickra at 2007-7-13 0:38:03 > top of Java-index,Desktop,Core GUI APIs...