Article View: borland.public.jbuilder.java.swing
Article #639Re: JTextPane KeyEvent
From: Aven
Date: Thu, 31 Mar 2005 23:02
Date: Thu, 31 Mar 2005 23:02
35 lines
2401 bytes
2401 bytes
Yes, I want to ensure that characters inserted are always inserted at the end of the document. Other behaviors are same as those of a normal JTextPane, i.e., I still want to reserve all Ctrl-C, Ctrl-V, ..., actions. How can I do that? My key listener somehow *consumes* the key event, so it prevents further processsing of the key event. Regards, Aven "John McGrath [TeamB]" <ng-b@JPMcGrath.net> wrote in message news:xn0e0e4pb4w2zzt00s@newsgroups.borland.com... > On 3/30/2005 at 7:24:06 PM, Aven wrote: > >> The problem arises as, my KeyListener only cares about normal characters, >> not action keys. On KeyPressed events, it sets the caret position to the >> end of document before the characters are entered into JTextPane. >> On KeyTyped events, it performs other actions on the characters. >> >> If I used key binding, should I bind every normal key to the action? >> It seems incovenient though. > > I am not sure what you are trying to do. Are you trying to ensure that > characters inserted are always inserted at the end of the buffer? If that > is it, somehow I missed where you said that. > > -- > Regards, > > John McGrath [TeamB] > > --------------------------------------------------- > Before sending me e-mail, please read: > http://www.JPMcGrath.net/newsgroups/e-mail.html
Technical Details
Message-ID:
<424c8099@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<424a7eeb$1@newsgroups.borland.com> <xn0e0dhxr4ianxy00l@newsgroups.borland.com> <424b4319$1@newsgroups.borland.com> <xn0e0e4pb4w2zzt00s@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 111d45,128b4a821bddbb34 X-Google-Attributes: gid111d45,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Aven" <aven_02@yahoo.com> Newsgroups: borland.public.jbuilder.java.swing References: <424a7eeb$1@newsgroups.borland.com> <xn0e0dhxr4ianxy00l@newsgroups.borland.com> <424b4319$1@newsgroups.borland.com> <xn0e0e4pb4w2zzt00s@newsgroups.borland.com> Subject: Re: JTextPane KeyEvent Date: Thu, 31 Mar 2005 15:02:44 -0800 Lines: 37 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 NNTP-Posting-Host: 128.111.68.241 Message-ID: <424c8099@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1112309913 128.111.68.241 (31 Mar 2005 14:58:33 -0800) Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail