It appears that this works...
public void actionPerformed(ActionEvent event) {
if (event.getSource().equals(button1)) {
button1Count++;
...
Type: Posts; User: joshft91
It appears that this works...
public void actionPerformed(ActionEvent event) {
if (event.getSource().equals(button1)) {
button1Count++;
...
Alright... Well I tried something like this - it compiles fine, but it increments the 2nd button only. :S
public void actionPerformed(ActionEvent event) {
if (event.equals(button1)){
...
Edit: Got it working - public void actionPerformed(ActionEvent event) {
buttonCount++;
button.setText(Integer.toString(buttonCount));
}
The second part to this problem...
I wasn't wasting my time... All I was saying was that I don't have a lot of other places to go for help.
I know I'm going to be incrementing it in the actionPerformed method. The text is set here...
Hey guys... so here's the "problem" now. When you compile and run this code as of now, it will bring up a screen with a button on it - when you click teh button it will do nothing.
We're supposed...