🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: JTextFieldSize

#8070
From: Joi Ellis [TeamB]
Date: Wed, 22 Nov 2000 00:00
21 lines
1590 bytes
James A. Schulz <jaschulz@wiseware.com> wrote:
> Joi,

> I am not sure I understand "count characters and not pixels".  To set the
> width of a display element requires counting pixels, doesn't it?

If the width of the item is expressed in characters, as the default width
specified in JTextField's constructor is expressed, then no, you don't need to
know the exact number of pixels.  This assumes, of course, that there aren't
some wierd bugs in your user platform which gets the size wrong for a particular
look and feel.

The only place in my app where I care about actual sizes in pixels is in my
unit tests, where I check that some dialogs and windows don't pack into a 
size larger than 640x480.  Even there, though, I'm not specifying the initial
size, I'm just checking against my design maximum.

-- 
Joi Ellis (TeamB) 
No direct email, please.
For best results, post on news server newsgroups.borland.com!
Technical Details
Message-ID: <8vgvv2$5dm12@bornews.inprise.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <8vemot$qj46@bornews.inprise.com> <3A1B0339.BFF34050@formlessvoid.com> <8vfduj$d2e4@bornews.inprise.com> <8vfmej$d2h11@bornews.inprise.com> <8vgpnp$5dm2@bornews.inprise.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,69aa350fde3e11dc
X-Google-Attributes: gid111d45,public
From: "Joi Ellis [TeamB]" <joi@aravox.com>
Subject: Re: JTextFieldSize
Date: 2000/11/22
Message-ID: <8vgvv2$5dm12@bornews.inprise.com>
X-Deja-AN: 696728062
References: <8vemot$qj46@bornews.inprise.com> <3A1B0339.BFF34050@formlessvoid.com> <8vfduj$d2e4@bornews.inprise.com> <8vfmej$d2h11@bornews.inprise.com> <8vgpnp$5dm2@bornews.inprise.com>
Organization: Another Netscape Collabra Server User
User-Agent: tin/1.4.2-20000205 ("Possession") (UNIX) (Linux/2.2.14-5.0 (i686))
Newsgroups: borland.public.jbuilder.java.swing