Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Move focus from specific jcombobox to specific jtextarea  RSS feed

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
Posts: 2941
  • 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:

It is annoying to spend the time answering a question only to find the question has been answered on another forum already
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!