This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Beginning Java and the fly likes novice seeking help with Calculator program Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "novice seeking help with Calculator program" Watch "novice seeking help with Calculator program" New topic
Author

novice seeking help with Calculator program

Charles Woods
Greenhorn

Joined: Jun 04, 2007
Posts: 7
I am a newby taking my first Java class. I have to create an Applet of a working Calculator. So far, all I know how to do is create buttons and JTextArea. I don't know how to set up any functionality among the components. I don't even know which is better to use; JTextField or TextArea. If anyone out there can help, I will be happy to wash your car and maybe even do some free yard work if you could give me some pointers.
Thanks.
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Hi, welcome to the ranch!

This is a big subject area, but fortunately Sun has pretty good tutorials on almost everything Java. See if the Swing Tutorial covers the right kinds of things.

For adding functionality to the widgets, what you're looking for is probably in the EventListener and ActionListener family. You add these objects to your UI components and Swing calls them when interesting things like mouse clicks and keystrokes happen.

If this seems like the right direction, you might wander over to the Swing forum with further questions.
[ July 05, 2007: Message edited by: Stan James ]

A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Charles Woods
Greenhorn

Joined: Jun 04, 2007
Posts: 7
Thanks for the help. I know how to set up the event handlers (sorry I didn't mention that). I guess I need to figure out which events to use. I have managed to get numbers to show up in the JTextArea, but I don't know how to get any results from the numbers.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: novice seeking help with Calculator program