编辑: 达达恰西瓜 | 2018-11-04 |
//字体大小//使字体变大 public void enlarge(){ this.
setSize( this.getSize() +
5 );
}//使字体变小public void abridge(){ this.setSize( this.getSize() -
5 );
} 应用实例(5):M类//观察者队列private List observers = new ArrayList();
public void addObservers( Observer observer ){this.observers.add( observer );
}//当模型有变更时,通知所有观察者改变相应的视图public void notif........