Advertisement
Guest User

Untitled

a guest
May 27th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. package gol;
  2.  
  3. import javax.swing.*;
  4. import java.awt.*;
  5.  
  6. public class MyButton extends JButton implements Observer {
  7. public MyButton(){
  8. super();
  9. }
  10. public void update(Subject subject){
  11. Cell cell = (Cell) subject;
  12. if(cell.getState()) setBackground(Color.WHITE);
  13. else setBackground(Color.BLACK);
  14.  
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement