SHARE
TWEET

Untitled

a guest May 27th, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top