🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: JTextFieldSize

#8060
From: James A. Schulz
Date: Tue, 21 Nov 2000 00:00
68 lines
2994 bytes
Rich,

Well, I don't know about the masochistic part, but this application would be
a breeze to write on a DOS terminal.  It would take too much time to explain
why, but what I need is a grid of characters (55 x 25), in uniformly sized
cells to which I can write, and a single line of identically sized cells
into which the user can enter a string of 50 chars max.

Is this at all feasible or is it just non-Java?

thanks,

James

"Rich Wilkman" <richw@formlessvoid.com> wrote in message
news:3A1B0339.BFF34050@formlessvoid.com...
> James:
>
> Do you want to limit the field to the entry of 50 characters or just the
> display.  Joi has you covered for display, though you may have to
> setText(50_M_CHARS) after the component is realized (i.e., is on the
screen).
> Also keep in mind that you can setPreferredSize to your hearts content but
a
> layout manager doesn't have to honor it.  I'd take the approach of
extending
> JTextField and overriding getPreferredSize(), myself.
>
> If you want to limit entry then you need to write some additional code to
plug
> in to the JTextField (or your extension).
>
> Also, you want 50 monospaced characters.  You don't say at what point size
you
> want them to fit.  50 22pt characters takes more than 50 8pt characters.
Also
> remember that after going through all this pain and suffering and having
it not
> work the same between browsers that the user can simply have font settings
> selected for their OS or Browser that simply don't work in your model.
>
> What are you trying to accomplish?  Right now it just seems to be some
> masochistic effort to bring forward a 70's style database approach for a
adm3a
> terminal.
>
> -Rich
>
> "James A. Schulz" wrote:
>
> > 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: <8vfduj$d2e4@bornews.inprise.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <8vemot$qj46@bornews.inprise.com> <3A1B0339.BFF34050@formlessvoid.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: "James A. Schulz" <jaschulz@wiseware.com>
Subject: Re: JTextFieldSize
Date: 2000/11/21
Message-ID: <8vfduj$d2e4@bornews.inprise.com>
X-Deja-AN: 696421405
References: <8vemot$qj46@bornews.inprise.com> <3A1B0339.BFF34050@formlessvoid.com>
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