1 package bookExamples.ch19Events.observables; 2 3 import java.util.Observable; 4 5 public class ObservableBoolean 6 extends Observable { 7 private boolean b = false; 8 9 public String toString() { 10 return "b=" + b; 11 } 12 13 public boolean isB() { 14 return b; 15 } 16 17 public void setB(boolean b) { 18 if (this.b == b) return; 19 this.b = b; 20 setChanged(); 21 } 22 } 23