somebody can help me...

Recommended Answers

All 5 Replies

this is only a school assignment,,, but i cant find a way how to solve it.

with a key listener, for instance. you add a key listener that checks the input given, if it's not a number or a ., have it consume the event.

In addition to the above, be sure to check input again before sending the actual input data. There are users who, when they can't type what they want, will copy-paste their garbage input (with the mouse obviously, how could they ever press two keys at once, that's just madness). Then when they don't get a result they'll call you in the middle of the night (because that's when "you guys" work right) telling you to come fix their mouse, because the "mouse inputs" are not getting results.

<heavy breathing>

Are you going to allow more than one . input?
How about backspace and left right keys?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.