'Need help making a Java swing Tic Tac Toe game Java

I need some help! I am making a java tictactoe game (with swing) and I have a problem. To make my move, I am using:

private void btn7ActionPerformed(java.awt.event.ActionEvent evt) {                                     
        if (btn7.getText().equals("Empty button") && funk == true) {
            btn7.setText(Playermove);

but I need to do the same thing for every button, is there another way to do this?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source