Figured it out thanks. Please delete.
Printable View
Figured it out thanks. Please delete.
I'm guessing you're losing a variable perhaps.
I'm noticing when I try to get rid of the 0 in the first box it comes back and won't clear.
You set it to default at 1 at think.
Going to try tweaking certain things to see what happens.
You could always keep setting the number to like
Integer.parseInt(secondBox.getText());
No idea why you're doing
public final void actionEvent ....
I don't understand the final part.
Anyway, I'm not sure what this code is supposed to do.
I've noticed that
Code java:if (e.getActionCommand().equals("subTract")) { if (setgood == 1) { String nos = stupid.getText(); String yos = yummy.getText(); int heck = Integer.parseInt(nos.trim()); int beck = Integer.parseInt(yos.trim()); heck --; beck --; //heck to nos //beck to yos shook.setText("First Editable Number:" + heck); nook.setText("Second Editable Number:" + beck); setbad ++; setgood++; revalidate(); } else { heck --; beck --; shook.setText("First Editable Number:" + heck); nook.setText("Second Editable Number:" + beck); revalidate(); } }
If setgood is 1, then it adds 1 to setgood.
That means next time it won't be 1 next time.
So it'll go to the else statement and set text text heck and stuff and continue decremnting heck and beck.
I don't know what revalidate() does.