🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #441

Re: Swap TAB and Ctrl-TAB for JTextArea

#441
From: Magnus
Date: Fri, 20 May 2005 14:45
33 lines
2430 bytes
No. I want to change the behavior of TAB for JTextArea.
When I have a panel with multiple text fields I use TAB to
go to the next field. However, as soon as I entered text in
a JTextArea I inserted a TAB instead of going to the next field.

I can't see why the implementation of TAB behavior should differ
for one component like that. In the MS world CTRL-TAB insert a tab
and I guess that that is what most user is expecting even for Java
developed applications.

Thanks for the input on traversal though - that is something I will
use in other  places.

John McGrath [TeamB] wrote:
> On 5/16/2005 at 3:32:48 PM, Magnus wrote:
> 
> 
>>     textArea.addKeyListener(new KeyAdapter(){
>>       public void keyPressed(KeyEvent ke){
>>         if(ke.getKeyCode() == KeyEvent.VK_TAB)
>>         {
>>           ke.consume();
>>           [nextComponent].requestFocus();
>>         }}});
> 
> 
> It looks like you are just trying to customize the tab order.  If that 
> is the case, you should look at java.awt.FocusTraversalPolicy.  For more
> information on Swing/AWT focus handling, see the trail "How to Use the
> Focus Subsystem" in the Java Tutorial:
> 
>     http://java.sun.com/docs/books/tutorial/uiswing/misc/focus.html
> 
Technical Details
Message-ID: <428df7f8@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news-out.nntp.be!propagator2-sterling.newsfeeds.com!news-in.nuthinbutnews.com!news-in.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <4288af18@newsgroups.borland.com> <4288beb7@newsgroups.borland.com> <4288f55a$1@newsgroups.borland.com> <xn0e2eokm9yv9kb000@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 111d45,21a389bc4e56d7b7
X-Google-Attributes: gid111d45,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Fri, 20 May 2005 10:45:31 -0400
From: Magnus <magnus_bjorkman@iwon.com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax)
X-Accept-Language: en-us, en, sv
MIME-Version: 1.0
Newsgroups: borland.public.jbuilder.java.swing
Subject: Re: Swap TAB and Ctrl-TAB for JTextArea
References: <4288af18@newsgroups.borland.com> <4288beb7@newsgroups.borland.com> <4288f55a$1@newsgroups.borland.com> <xn0e2eokm9yv9kb000@newsgroups.borland.com>
In-Reply-To: <xn0e2eokm9yv9kb000@newsgroups.borland.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 71.0.99.227
Message-ID: <428df7f8@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1116600312 71.0.99.227 (20 May 2005 07:45:12 -0700)
Lines: 33
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news-out.nntp.be!propagator2-sterling.newsfeeds.com!news-in.nuthinbutnews.com!news-in.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail