Tab key in JTextArea
I would like to know how to select text in a text area by pressing Tab key on the keyboard instead of just getting the Tab char inserted in my text.
I'm using NetBeans IDE and made a simple interface for my program.
I've got a menu bar and a text area. I've assigned a keyboard shortcut for the button on a menu bar. When it's set to "Ctrl" + [something] everything works fine, but when I set it to "TAB" it just inserts a tab in my text.
By pressing a button on the menu bar, the action gets performed.
How to solve this?
All text components already have a bunch of select Actions defined by default. They may use different key bindings but you can remap the bindings if you desire. For more information check out: