🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: jTextField: String justification problem

#10235
From: enisoc
Date: Mon, 01 Nov 1999 00:00
38 lines
1776 bytes
the javax.swing.JTextComponent setCaretPosition(int) works for me, just set
it to 0.

hope this helps,
Anthony

Redding Bacon <reddingbacon@msn.com> wrote in message
news:7vi8ut$eos7@forums.borland.com...
> Hey all,
>
> I am using JB3 to create Java2 applets and I am using all swing
components.
> Each applet has several JTextComponents that it uses to display text.  The
> text that is displayed is sometimes longer than the TextComponent used to
> display it.  When this happens you can only see the end of the string in
the
> text field.  For example,  say that I have the following JTextField and
set
> its text:
>
>     JTextField jt = new JTextField();
>     jt.setSize(20, 20);                           /* really short text
field
> */
>     String string = "This is a test string for the test JTextField";
>     jt.setText(string);
>
> In this example, when I run the applet the jt text field will display the
> string but you will only see the last few characters of it.  It would much
> better if it could display the first part of the string instead.  How can
I
> do that?  I've looked everywhere, but can't figure it out.  Anyone have a
> sugestion?
>
> Thanks,
> Redding
>
>
Technical Details
Message-ID: <7vktn9$70d16@forums.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <7vi8ut$eos7@forums.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,439b8cbe49d2cafd
X-Google-Attributes: gid111d45,public
From: "enisoc" <enisoc@hotpop.com>
Subject: Re: jTextField:  String justification problem
Date: 1999/11/01
Message-ID: <7vktn9$70d16@forums.borland.com>
X-Deja-AN: 543225575
References: <7vi8ut$eos7@forums.borland.com>
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
Organization: Another Netscape Collabra Server User
X-MSMail-Priority: Normal
Newsgroups: borland.public.jbuilder.java.swing