Article View: comp.lang.java.programmer
Article #289How to place the blinking bar in a TextField?
From: Ramon F Herrera
Date: Thu, 04 Jul 2002 23:51
Date: Thu, 04 Jul 2002 23:51
19 lines
1784 bytes
1784 bytes
My application has a JLabel, a JTextField next to it and a button. The user is suppossed to type some value inside the text field and either (a) press <return> or (b) click in the "run" button. So I have two questions: how can I associates the return key being pressed to the program performing a certain action? (currently the only way is by clicking on the button). I guess the button must be highlighted in a special way first. How can I position the vertical text editing blinking bar inside the text field programmatically? Currently the bar is in the desired (and only) text field only the first time the app is executed, form then on, the user has to click inside the text field to locate the bar there. TIA, -Ramon F. Herrera
Technical Details
Message-ID:
<c9bc36ff.0207041551.7fbef893@posting.google.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!postnews1.google.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10a146,223d7bcb7f0e20ff,start X-Google-Attributes: gid10a146,public X-Google-Thread: fa3e3,223d7bcb7f0e20ff,start X-Google-Attributes: gidfa3e3,public X-Google-Thread: 10fd6d,223d7bcb7f0e20ff,start X-Google-Attributes: gid10fd6d,public X-Google-ArrivalTime: 2002-07-04 16:51:59 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!postnews1.google.com!not-for-mail From: ramon@conexus.net (Ramon F Herrera) Newsgroups: comp.lang.java.programmer,comp.lang.java.gui,borland.public.jbuilder.ide Subject: How to place the blinking bar in a TextField? Date: 4 Jul 2002 16:51:58 -0700 Organization: http://groups.google.com/ Lines: 19 Message-ID: <c9bc36ff.0207041551.7fbef893@posting.google.com> NNTP-Posting-Host: 65.96.170.111 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1025826719 28401 127.0.0.1 (4 Jul 2002 23:51:59 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 4 Jul 2002 23:51:59 GMT