🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

jTextField: String justification problem

#10230
From: Redding Bacon
Date: Sun, 31 Oct 1999 00:00
23 lines
1441 bytes
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: <7vi8ut$eos7@forums.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,439b8cbe49d2cafd,start
X-Google-Attributes: gid111d45,public
From: "Redding Bacon" <reddingbacon@msn.com>
Subject: jTextField:  String justification problem
Date: 1999/10/31
Message-ID: <7vi8ut$eos7@forums.borland.com>
X-Deja-AN: 542837870
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
Organization: RMS
X-MSMail-Priority: Normal
Newsgroups: borland.public.jbuilder.java.swing