Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Move focus from specific jcombobox to specific jtextarea  RSS feed

 
Alex Monari
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

How do I move focus from a jcombobox to a specific component say a jtextarea.

My attempt below seems to be moving to a random component not the desired jtextarea.



I applied the above logic to move focus from a specific jtextarea to another jtextarea as seen below and it works as desired.



Any help is appreciated
 
Rob Camick
Ranch Hand
Posts: 2752
11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In general Swing manages the tab key and move the focus from the current component to the next component.

However, some components, like a JTextArea and JTextPane and JTable, disable the default functionality of the tab key because the component handles the tab key. In the case of JTable the tab key move the focus from cell to cell. In the text components a tab character is added to the Document of the text component.

Read the section from the Swing tutorial on The Focus Subsystem for more information.

Quit crossposting: http://stackoverflow.com/questions/26762811/move-focus-from-specific-jcombobox-to-specific-jtextarea

It is annoying to spend the time answering a question only to find the question has been answered on another forum already
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!