Search:

Type: Posts; User: javapenguin

Search: Search took 0.09 seconds.

  1. Replies
    10
    Views
    1,636

    Re: Calculator problem

    How about this for times


    int whatever = Integer.parseInt(textField.getText());

    textField.setText(" ");

    // now here's where I'm not sure what'll happen

    int whatever2 =...
  2. Replies
    10
    Views
    1,636

    Re: Calculator problem

    x = x + 1;

    What is this doing?

    How is that value being saved?

    I can't find where x was initialized.
  3. Replies
    10
    Views
    1,636

    Re: Calculator problem

    I'm pretty sure your error is in this part

    public void actionPerformed(ActionEvent e) {
    if (e.getSource()==b1) {
    String text = textField.getText();
    ...
  4. Replies
    10
    Views
    1,636

    Re: Calculator problem

    And you'd have to have

    button.addActionListener(this);
  5. Replies
    10
    Views
    1,636

    Re: Calculator problem

    On a side note, you could just define all your buttons in a constructor.

    But if you do that, they probably shouldn't be static anymore.
  6. Replies
    10
    Views
    1,636

    Re: Calculator problem

    Oh....wait, that's what it's supposed to do.

    But I noticed that the word "Final" was highlighted as a keyword or as a class.
  7. Replies
    10
    Views
    1,636

    Re: Calculator problem

    textField.setText(text+"3")

    I doubt that's adding anything.

    All it appears to do is append a 3 to the String text.
Results 1 to 7 of 7