Article View: borland.public.jbuilder.java.language
Article #19577Still having trouble with textField, Integer conversion and math
From: Dan French
Date: Sat, 24 Jan 1998 00:00
Date: Sat, 24 Jan 1998 00:00
57 lines
2202 bytes
2202 bytes
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);
Integer total = (Integer.valueOf(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
>
>
>
Technical Details
Message-ID:
<01bd28f2$df40bb40$a87f85cd@default>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,5c77b3db67a8a615,start X-Google-Attributes: gidf74b3,public From: "Dan French" <user@msn.com> Subject: Still having trouble with textField, Integer conversion and math Date: 1998/01/24 Message-ID: <01bd28f2$df40bb40$a87f85cd@default> X-Deja-AN: 318898788 Organization: macroworks Newsgroups: borland.public.jbuilder.java.language