ok so im making a Calculator..and i got the graphic part..and id ont know how to do the math..
i got 2 files one for the graphic..and the other for the math..for like the caluction
import java.awt.*;
import java.awt.event.*;
public class Calculatorsgui extends Frame implements WindowListener
{
protected Button plus, subract, times, divide, exitButton;
protected TextField input1, input2, answer;
private Calculatorsgui controller;

public Calculatorsgui ()
{
setTitle ("Calculator"); // Set the frame's name

setLayout (new FlowLayout (FlowLayout.CENTER));

setSize (180, 180); // Set the frame's size

// SimpleController is a class that handles the button clicks
CalculatorsController controller = new CalculatorsController (this);

so if anyone can do thing for me..u be my hero..no JOKES!!!!!!!!!! PLEASE HELP ..im on my knees

01-17-2005, 05:45 AM

sjalle

First, you cannot add components to a flowlayout container using borderlayout constraints (north, south,
east,west and center), and if you use borderlayout
you cannot add more than 5 components, one for each
place.

If you want to respond to buttonclicks then the usual
approach is to let the frame implement the
ActionListener interface. You don't have to make a
special class for listening to events, any class can do that, as long as it implements the event's listener interface.

Leaving out the number-keypad solution your code could
be done like this: