public void actionPerformed(ActionEvent event) { JButton button = (JButton) event.getSource(); String location = button.getName().substring(8); int row = Integer.parseInt(location.substring(0, 1)); int column = Integer.parseInt(location.substring(1, 2)); model.markBoard(row, column); button.setText(model.checkSpot(row, column)); checkForWin(row, column); }