how to create a calculator by using javax swing

I try to us Javax swing make some buttons like 0 - 9 then input some numbers by using those number like a calculator. But I only can get numbers no more than 9.Please help me.
[196 byte] By [jsongs] at [2007-9-26 1:25:56]
# 1

How do you store the number the user enters? If it's in a string and the previous value was eg "1" and the user enters "2" you get "12" with a simple concatenation: val += input.

OTOH, if you work with doubles and the previous value was 1.0 and the user enters 2.0 by pressing the button you get 12.0 by multiplying 1.0 with 10 and adding 2.0: val = 10*val + input.

jsalonen at 2007-6-29 1:08:10 > top of Java-index,Archived Forums,Java Programming...