🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #19592

Re: Still having trouble with textField, Integer conversion and math

#19592
From: Paul L. Mowatt
Date: Mon, 26 Jan 1998 00:00
97 lines
3670 bytes
This is a multi-part message in MIME format.
--------------5C635083423E257871BD6077
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit



Dan French wrote:

> I'm stilltrying to figure this out so be patient......
>
> My applet is going to take the users input from textField2, multiply it by
> 1500, and display the answer in textField2 but it doesn't seem to work.  I
> know it's something simple I am missing.  Any suggestions?  The code is
> below:
>
>     String foot = textFieldControl3.getText();
>     Integer.valueOf(foot);

// Remove the above line (dead code).

>     Integer total = (Integer.valueOf(foot))*1500;

//    Change above line to...       Integer total = new
Integer(Integer.parseInt(foot) * 1500);

>     textFieldControl2.setText(String.valueOf(total));
>
> without the *1500, the string from textFieldControl3 displays in
> textFieldControl2 so I know I am grabbing the users input okay but I get an
> error when I try to perform the calculation. What do you think?
>
> Any help is appreciated.
> Dan French
> email@macroworks.com
>
> Allan Bressler <abressler@earthlink.net> wrote in article
> <34C66596.9E7F39AE@earthlink.net>...
> > See the thread above called "Still trying to convert from string to
> double"
> > with myself as the sender.
> >
> > If you need more help, let me know.
> >
> > Allan
> >
> > Dan French wrote:
> >
> > > I want to develop a simple calculation applet that takes user (numeric)
> > > input from a textFieldControl and simply displays the answer in a
> second
> > > textFieldControl.  In other words, in textFieldControl1 the user is to
> > > enter the number of square feet he or she wants to "finish" (this is a
> > > floor finish calculator), and the applet will display the number of
> gallons
> > > needed for the job in textFieldControl2.
> > >
> > > The equation is simple; textFieldControl1 * 1500 = textFieldControl2.
> What
> > > is the best way to accomplish this?  I can't seem to figure out how to
> get
> > > integers entered into textFieldControls into math formulas.
> > >
> > > please help
> > >
> > > Dan French
> > > email@macroworks.com
> >
> >
> >



--------------5C635083423E257871BD6077
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Paul Mowatt
Content-Disposition: attachment; filename="vcard.vcf"

begin:          vcard
fn:             Paul Mowatt
n:              Mowatt;Paul
org:            Call Sciences, Inc.
adr:            379 Thornall Street;;Suite 1100;Edison;NJ;08837;USA
email;internet: plm@jamaica.tpsinc.com
title:          Senior Development Engineer
tel;work:       (732) 767-5428
tel;fax:        (732) 767-5428
tel;home:       (732) 767-5428
x-mozilla-cpt:  reggae.callsciences.com;2
x-mozilla-html: TRUE
version:        2.1
end:            vcard


--------------5C635083423E257871BD6077--
Technical Details
Message-ID: <34CCC393.783D39A5@jamaica.tpsinc.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <01bd28f2$df40bb40$a87f85cd@default>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,5c77b3db67a8a615
X-Google-Attributes: gidf74b3,public
From: "Paul L. Mowatt" <plm@jamaica.tpsinc.com>
Subject: Re: Still having trouble with textField, Integer conversion and math
Date: 1998/01/26
Message-ID: <34CCC393.783D39A5@jamaica.tpsinc.com>
X-Deja-AN: 319412098
References: <01bd28f2$df40bb40$a87f85cd@default>
Mime-Version: 1.0
Reply-To: plm@jamaica.tpsinc.com
To: Dan French <user@msn.com>
Content-Type: multipart/mixed; boundary="------------5C635083423E257871BD6077"
Organization: Call Sciences, Inc.     "Reggae Boyz - Out of 32, one team"
Newsgroups: borland.public.jbuilder.java.language