🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: JTextFieldSize

#7768
From: Chris Denham
Date: Fri, 15 Dec 2000 15:55
24 lines
1708 bytes
James,
I have done something similar to this but using a JTextPane.
I can send you my code if it's of interest.
Chris.

"James A. Schulz" <jaschulz@wiseware.com> wrote in message
news:8vemot$qj46@bornews.inprise.com...
> 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: <3a3a3ee3$1_2@dnews>
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!news-x.support.nl!colt.net!news.maxwell.syr.edu!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!bornews.borland.com!dnews!137.108.41.217
References: <8vemot$qj46@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
X-Google-ArrivalTime: 2000-12-15 07:57:00 PST
Reply-To: "Chris Denham" <c.m.denham@open.ac.uk>
From: "Chris Denham" <c.m.denham@open.ac.uk>
Newsgroups: borland.public.jbuilder.java.swing
References: <8vemot$qj46@bornews.inprise.com>
Subject: Re: JTextFieldSize
Date: Fri, 15 Dec 2000 15:55:02 -0000
Lines: 26
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
NNTP-Posting-Host: 137.108.41.217
Message-ID: <3a3a3ee3$1_2@dnews>
X-Trace: 15 Dec 2000 07:55:15 -0800, 137.108.41.217
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!news-x.support.nl!colt.net!news.maxwell.syr.edu!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!bornews.borland.com!dnews!137.108.41.217