You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Demo.java 908B

1234567891011121314151617181920212223242526272829
  1. /*
  2. Copyright (c) Xerox Corporation 1998-2002. All rights reserved.
  3. Use and copying of this software and preparation of derivative works based
  4. upon this software are permitted. Any distribution of this software or
  5. derivative works must comply with all applicable United States export control
  6. laws.
  7. This software is made available AS IS, and Xerox Corporation makes no warranty
  8. about the software, its performance or its conformity to any specification.
  9. */
  10. package observer;
  11. public class Demo {
  12. public static void main(String[] args) {
  13. Display display = new Display();
  14. Button b1 = new Button(display);
  15. Button b2 = new Button(display);
  16. ColorLabel c1 = new ColorLabel(display);
  17. ColorLabel c2 = new ColorLabel(display);
  18. ColorLabel c3 = new ColorLabel(display);
  19. b1.addObserver(c1);
  20. b1.addObserver(c2);
  21. b2.addObserver(c3);
  22. }
  23. }