Article View: borland.public.jbuilder.java.swing
Article #451Re: Swap TAB and Ctrl-TAB for JTextArea
From: John McGrath [TeamB]
Date: Wed, 25 May 2005 07:57
Date: Wed, 25 May 2005 07:57
57 lines
3725 bytes
3725 bytes
On 5/24/2005 at 9:19:58 AM, Magnus wrote:
> Now, why is it that a text entry that can work with more than one row
> (i.e. text area) insert a TAB but not a text entry for one row (even
> though it can be very long)? I don't know what criteria was behind the
> TAB decision but I would probably stick with consistency (but that is
> just me).
JTextField allows the user to enter normal characters, while JTextArea
allows the user to insert basic formatting information - in other words,
control characters. So to me, it seems inconsistent to allow TABs, but
not allow newlines.
I also think it is quite rare to actually need to insert TAB characters
into a text field. I searched through many applications on my system,
and while I found a few that would insert a TAB on Control-TAB, I found
none where it actually made sense to do so.
So I do not think it makes sense for this to be the default behavior for
a JTextField. In the rare cases where it is useful, it can be added.
> > It does not do that consistently. I have found many Microsoft
> > applications on my system in which that does not work.
>
> I have found that to but it is not common.
On the applications on my system, it is *extremely* common. I have looked
at many applications (Microsoft Word, Excel, Outlook, Notepad, FileZilla,
Remote Desktop, Internet Explorer, Mozilla, Firefox, Thunderbird,
Netscape, Opera, XanaNews ...), and all of them have text fields that do
not insert a tab character on Ctrl-TAB. I found very few text fields that
did exhibit that behavior.
> > Are you aware of any official MS specification that says that the TAB
> > key should work that way?
>
> No.
If there was one, then I would expect the Swing team to follow it for the
Windows look-and-feel, but not others. But given that it seems to be an
ad-hoc thing, I am not surprised that it is not.
> All browsers I use (explorer, netscape and firefox) also use tab to
> traverse.
That is what JTextField does also. I thought you were saying that
JTextField should respond to Ctrl-TAB by inserting a TAB character.
That behavior is quite rare, as far as I can see.
--
Regards,
John McGrath [TeamB]
---------------------------------------------------
Before sending me e-mail, please read:
http://www.JPMcGrath.net/newsgroups/e-mail.html
Technical Details
Message-ID:
<xn0e2nqcxiwpsbv006@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news2.google.com!proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!feeder1.cambrium.nl!feed.tweaknews.nl!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<4288af18@newsgroups.borland.com> <4288beb7@newsgroups.borland.com> <4288f55a$1@newsgroups.borland.com> <xn0e2eokm9yv9kb000@newsgroups.borland.com> <428df7f8@newsgroups.borland.com> <xn0e2kwjfg0utas003@newsgroups.borland.com> <429329f6$1@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 From: "John McGrath [TeamB]" <ng-b@JPMcGrath.net> Subject: Re: Swap TAB and Ctrl-TAB for JTextArea Newsgroups: borland.public.jbuilder.java.swing References: <4288af18@newsgroups.borland.com> <4288beb7@newsgroups.borland.com> <4288f55a$1@newsgroups.borland.com> <xn0e2eokm9yv9kb000@newsgroups.borland.com> <428df7f8@newsgroups.borland.com> <xn0e2kwjfg0utas003@newsgroups.borland.com> <429329f6$1@newsgroups.borland.com> User-Agent: XanaNews/1.17.4.1 Message-ID: <xn0e2nqcxiwpsbv006@newsgroups.borland.com> X-Ref: newsgroups.borland.com ~XNS:00000418 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 NNTP-Posting-Host: 151.197.212.47 Date: 25 May 2005 00:57:31 -0700 X-Trace: newsgroups.borland.com 1117007851 151.197.212.47 (25 May 2005 00:57:31 -0700) Lines: 57 X-Authenticated-User: jpmcgrath Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news2.google.com!proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!feeder1.cambrium.nl!feed.tweaknews.nl!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail