aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Newbie, Please Help: Why can I not get the numbers to display Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Newbie, Please Help: Why can I not get the numbers to display" Watch "Newbie, Please Help: Why can I not get the numbers to display" New topic
Author

Newbie, Please Help: Why can I not get the numbers to display

Patrick Miller
Greenhorn

Joined: Nov 17, 2004
Posts: 3
I have to write a program that shows three stations that collect numerical data for rainfall. I suppose to be able to put the number in and click enter and the number will show up in the box beside the input box. Then the input box goes back to 0.0, and anytime I add a number to it, it totals to the box on the right. What am I doing wrong? Please help. I am running out of time. Here is the program I have written so far.


[ November 17, 2004: Message edited by: Patrick Miller ]

"The only thing that matters in life is Family."
Patrick Miller
Greenhorn

Joined: Nov 17, 2004
Posts: 3
Please help with this. I need to have it done by tonight. Thank you.
Don Kiddick
Ranch Hand

Joined: Dec 12, 2002
Posts: 580
super("Eric Luce's Final Project");


Patrick, what are you doing with Eric's project ?
Ben Wood
Ranch Hand

Joined: Aug 14, 2001
Posts: 342
Patrick,

Look carefully at the code I've changed from your version.



I have got the first two stations working and have left the last for you to figure out. There were one or two small problems with the way you were creating and initialising your GUI components. You were declaring at the top for example like

JTextField j = etc etc

and then creating j again lower down in the contstructor method.

If you look closely at the code I have changed, especially where the ocmponents are created, you should be able to figure out how to add inthe third station yourself.


SCJP 1.4, www.gsi3d.org.uk
Ben Wood
Ranch Hand

Joined: Aug 14, 2001
Posts: 342
what are you doing with Eric's project ?



hmm, good point. didn't spot that. :roll:

I forgot to mention also that you need to look at what I've done to retrieve the contents of each text field and convert that string to a double. What you had before (especially myNumberIn1() ) made no sense. myNumberIn1 is a JTextField object which has a method getText().
Patrick Miller
Greenhorn

Joined: Nov 17, 2004
Posts: 3
Originally posted by Don Kiddick:


Patrick, what are you doing with Eric's project ?


Ok, you caught me. Now you know my real name. The other name I use for privacy.
[ November 17, 2004: Message edited by: Patrick Miller ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Newbie, Please Help: Why can I not get the numbers to display