🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

JTextFieldSize

#8056
From: James A. Schulz
Date: Tue, 21 Nov 2000 00:00
13 lines
1096 bytes
I want a JTextField that will accomodate exactly 50 Monospaced characters.
I set the "Columns" property to 50, but that doesn't seem to have any effect
because I can enter more than 50 characters and the dimensions of the field
give it much more width than it needs.

I know that fonts are variable from platform to platform, but this app
requires a precise size for this field.  Is my only strategy to determine
the font character width at run time and then resize my entire applet?
Please tell me there is an easier way.

thanks,

James
Technical Details
Message-ID: <8vemot$qj46@bornews.inprise.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,69aa350fde3e11dc,start
X-Google-Attributes: gid111d45,public
From: "James A. Schulz" <jaschulz@wiseware.com>
Subject: JTextFieldSize
Date: 2000/11/21
Message-ID: <8vemot$qj46@bornews.inprise.com>
X-Deja-AN: 696303674
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
Organization: Another Netscape Collabra Server User
X-MSMail-Priority: Normal
Reply-To: "James A. Schulz" <jaschulz@wiseware.com>
Newsgroups: borland.public.jbuilder.java.swing