I got 1 when i pass button and if i pass the second timeis still 1 not is ++

int click = 0;
public ButtonHandler(int x, int y, MineGrid g)
row = x;
col = y;
grid = g;
public void actionPerformed(ActionEvent event)
    click ++;
    JButton button = (JButton)event.getSource();
    //        click ++;

    button.setText(String.valueOf(grid.getInfoAt(row, col)));
     //      click ++;
    System.out.println (click);


Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.