Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package gol;
- import javax.swing.*;
- import java.awt.*;
- public class MyButton extends JButton implements Observer {
- public MyButton(){
- super();
- }
- public void update(Subject subject){
- Cell cell = (Cell) subject;
- if(cell.getState()) setBackground(Color.WHITE);
- else setBackground(Color.BLACK);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement