🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Question about jTextField Control

#13037
From: Jeff Wild
Date: Fri, 09 Oct 1998 00:00
18 lines
1054 bytes
In article <6uo4r3$jci5@forums.borland.com>, "Tony Tse" <tselm@ha.org.hk> wrote:
>I have a problem about the JTextfield Control. How can I set the position of
>the cursor under the first letter of the text inside the textfield control ?
>Thanks for anyone who can help me ?
>
>Tony Tse
>
>

if i understand your problem correctly, jTextField.setCaretPostion(int), where 
int is the position of the character, should work.

if you want the first character selected for edit:

jTextField.setSelectionStart(0);
jTextField.setSelectionEnd(1);

hope this helps
Technical Details
Message-ID: <361e068f.0@news3.uswest.net>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <6uo4r3$jci5@forums.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,78c973d897411d31
X-Google-Attributes: gid111d45,public
From: jwild@oriental.com (Jeff Wild)
Subject: Re: Question about jTextField Control
Date: 1998/10/09
Message-ID: <361e068f.0@news3.uswest.net>
X-Deja-AN: 399340234
X-Report: Report abuse to abuse@uswest.net.
References: <6uo4r3$jci5@forums.borland.com>
X-Trace: 9 Oct 1998 07:50:23 +0500, 204.26.73.2
Newsgroups: borland.public.jbuilder.java.swing