Search:

Type: Posts; User: joshft91

Search: Search took 0.07 seconds.

  1. Replies
    10
    Views
    2,050

    Re: Incrementing button by 1

    It appears that this works...

    public void actionPerformed(ActionEvent event) {
    if (event.getSource().equals(button1)) {
    button1Count++;
    ...
  2. Replies
    10
    Views
    2,050

    Re: Incrementing button by 1

    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)){
    ...
  3. Replies
    10
    Views
    2,050

    Re: Incrementing button by 1

    Edit: Got it working - public void actionPerformed(ActionEvent event) {
    buttonCount++;
    button.setText(Integer.toString(buttonCount));

    }


    The second part to this problem...
  4. Replies
    10
    Views
    2,050

    Re: Incrementing button by 1

    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...
  5. Replies
    10
    Views
    2,050

    Incrementing button by 1

    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...
Results 1 to 5 of 5