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 =...
Type: Posts; User: javapenguin
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 =...
x = x + 1;
What is this doing?
How is that value being saved?
I can't find where x was initialized.
I'm pretty sure your error is in this part
public void actionPerformed(ActionEvent e) {
if (e.getSource()==b1) {
String text = textField.getText();
...
And you'd have to have
button.addActionListener(this);
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.
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.
textField.setText(text+"3")
I doubt that's adding anything.
All it appears to do is append a 3 to the String text.