Advertisement
Guest User

Untitled

a guest
Dec 3rd, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. public void actionPerformed(ActionEvent e)
  2. {
  3.  
  4.  
  5. if(placementLimit < 5){
  6.  
  7. //placementlimit is limit to buttons clicked
  8.  
  9. JButton clickedButton = (JButton)e.getSource();
  10.  
  11. clickedButton.setBackground(Color.RED);
  12. /* something like: int pos = clickedButton.getGridPos
  13. * arrayplacedpositions.add(pos);
  14. */
  15. placementLimit++;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement