wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes Disable tab event in JTextArea Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Disable tab event in JTextArea" Watch "Disable tab event in JTextArea" New topic
Author

Disable tab event in JTextArea

Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Is there a way to do this? I need to disable it, so that I can force the TAB key to move to the next focusable component, instead of spacing in the JTextArea.
Thanks.


GenRocket - Experts at Building Test Data
Eric Low
Ranch Hand

Joined: Mar 14, 2002
Posts: 41
Try this:

The above code basically detect the TAB keystroke in JTextPane and perform your "pre-defined" action instead.
Hope this helps.
Cheers
Eric Low
SCJP2
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Eric, Thank you soo much. That is going to work out great for me.
Thanks again.
Eric Low
Ranch Hand

Joined: Mar 14, 2002
Posts: 41
You're welcome!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Disable tab event in JTextArea