wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes calculator applet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "calculator applet" Watch "calculator applet" New topic
Author

calculator applet

Jade Davidson
Ranch Hand

Joined: Oct 12, 2001
Posts: 64
I am doing this calculator applet and it is working except for some reason it is only taking single digits. I don't know why. I thought I was setting it up so that the second digit would concatenate to the first digit. Any help on this would be great.
My code is below. I am sorry if it is not formatted correctly; I couldn't figure out how I was supposed to format it for this board.


[This message has been edited by Marilyn deQueiroz (edited December 17, 2001).]
Kaspar Dahlqvist
Ranch Hand

Joined: Jun 18, 2001
Posts: 128
Hi, Jade!
Notice the statement
first_num_flag = true;
on the last line of the mousePressed(MouseEvent m)-method. I think that line is the problem. I haven't studied your code too closely, but try removing it and see what happens.
Hope this helps!
//Kaspar
Niklas Junel
Greenhorn

Joined: Dec 19, 2001
Posts: 11
I haven't looked to closely, but instead of concatenating strings, why don't you use a StringBuffer-object which you can change in the way you want.You can find it in java.lang package.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: calculator applet
 
Similar Threads
Calculator - Stacks
problem with program
help
another question on calculator applet
what each part of this program does