🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Monospaced and Higher Unicode Characters

#7859
From: James A. Schulz
Date: Fri, 01 Dec 2000 00:00
82 lines
3451 bytes
Rich,

Thanks.  At least I won't waste time trying to work with jTextField.

My "Windows" solution involved writing a specialized input field, I just
hoped I could avoid that this time.

I'll let you know if I succeed.

thanks again,

James

"Rich Wilkman" <richw@formlessvoid.com> wrote in message
news:3A2833BA.499E689B@formlessvoid.com...
> James:
>
> If I knew of a way, I'd tell you. :-) Strings aren't really 'painted' the
way
> you want.  A few years ago and on Windows I'd have said you need to do
"owner
> draw" and paint the pixels where you wanted them.  You could still do that
in
> Java if you really wanted to.
>
> Thinking outside the computer for a moment, you really want your text
field to
> behave as if it were a bunch of wooden blocks with a particular character
> centered on the block.  You'd need to write your own container for those
wooden
> boxes.  It could even take input from a JTextField on each character
stroke if
> you wanted.  Maybe you need to investigate your own widget -- it doesn't
look
> like you're gonna get JTextField to bend to your will on this one.
>
> Have you looked at the info available from java.awt.FontMetrics?  If you
can
> switch to JDK 1.2 and use Java2D you can get even more info.  I don't know
if it
> will be enough.
>
> -Rich
>
> "James A. Schulz" wrote:
>
> > Rich,
> >
> > Thanks for you long note.
> >
> > I realize I have been working against the "Java way", but I don't have a
> > choice.  Let me explain what I am up to.
> >
> > My app is a kind of calculator.  The user enters an expression in the
> > jTextField and then, in a jTable positioned directly above the
jTextField,
> > and having its columns aligned with the characters of the field (one
column
> > per character), the app "parses" the expression.  (The main task is to
> > diagram the way in which the parentheses in the expression are
"nested").
> >
> > The original DOS version of this app was a "natural" on the old
character
> > screen.  I have created a Delphi version which works too, but I want to
move
> > the app to the web, and, as you have seen, I am having a devil of the
time.
> >
> > I don't really care much about the font so long as I can force the
> > characters in my expression into a series of equal width "cells" and
adjust
> > the width of the app to accomodate 50 cells.  I know how to draw a
string
> > like this using a character iterator, but I don't know how to get
jTextField
> > to draw like that.  Any suggestions?
> >
> > thanks,
> >
> > James
>
Technical Details
Message-ID: <909nfd$b3e8@bornews.inprise.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <906d8v$cq63@bornews.inprise.com> <MPG.14912621d190d0f989d82@forums.borland.com> <9088jr$apb4@bornews.inprise.com> <uofyw444r.fsf@sds.no> <908hh3$o9l2@bornews.inprise.com> <3A27EA61.B6E7F02@formlessvoid.com> <90941u$b3e1@bornews.inprise.com> <3A2833BA.499E689B@formlessvoid.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,e7b0355fee419750
X-Google-Attributes: gid111d45,public
From: "James A. Schulz" <jaschulz@wiseware.com>
Subject: Re: Monospaced and Higher Unicode Characters
Date: 2000/12/01
Message-ID: <909nfd$b3e8@bornews.inprise.com>
X-Deja-AN: 700162382
References: <906d8v$cq63@bornews.inprise.com> <MPG.14912621d190d0f989d82@forums.borland.com> <9088jr$apb4@bornews.inprise.com> <uofyw444r.fsf@sds.no> <908hh3$o9l2@bornews.inprise.com> <3A27EA61.B6E7F02@formlessvoid.com> <90941u$b3e1@bornews.inprise.com> <3A2833BA.499E689B@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