[Solved] How to make a variable that can be used for storing integer data in Java GUI

[ad_1]

You should replace your scoreadd method by this:

public void scoreadd(){
    Scorelbl.setText(String.valueOf(++scoreadd));
}

The attribute scoreadd is already there. The ++scoreadd operation increases its value by 1. Then, the label is updated.

1

[ad_2]

solved How to make a variable that can be used for storing integer data in Java GUI