I am making a chat box and was wondering how to get the focus on the JTextArea portion that I am typing in. As it is now, I have to click in the JTextArea everytime before I type something. I would like to not have to do that. Any suggestions?
posted 16 years ago
It is a JComponent so you can requestFocus() if it is setRequestFocusEnabled(). Or you can setDefaultFocus().
"JavaRanch, where the deer and the Certified play" - David O'Meara
Sorry if I sound dumb, but, do I setRequestFocusEnabled on the InternalFrame itself or on the JTextArea I need to focused, and then again on the requestfocus. Do I say myInternalFrame.requestFocus(myTextArea)??