requestFocus problem

Hello,

I have tried using requestFocus , requestFocusInWindow , and using a thread and calling

requestFocus using invokeLater , however none of the above methods are putting the focus on the textField. However if I unfocus the window my app is running in , then refocus the window , the JTextField

then gets focus. What can I do to have the textField grab the focus right away? Dont know

if it matters but my textField is visible in a JSplitPane , I call requestFocus from another component in

the "other" pane of the splitPane.

Thanks,

Jason Davis

[600 byte] By [mohadib_a] at [2007-10-1 1:13:00]
# 1

Hate to answer my own question... but it beats waiting on you slackers :p

(Just kidding , you guys are great)

So, to get focus on the text field I just needed to unfocus everything then requestFocus.

i.e.

SwingUtilities.invokeLater(new Runnable() {

public void run() {

KeyboardFocusManager.getCurrentKeyboardFocusManager().clearGlobalFocusOwner();

claimKeyTF.requestFocusInWindow();

}

} );

mohadib_a at 2007-7-8 1:29:33 > top of Java-index,Security,Event Handling...