• Post Reply Bookmark Topic Watch Topic
  • New Topic

JTextArea  RSS feed

 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is a JComponent so you can requestFocus() if it is setRequestFocusEnabled(). Or you can setDefaultFocus().
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)??
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!